1.1 Data representation Flashcards
What is binary and why is it different to denary?
Denary is the base 10 number system we use everyday. Because computers consist of millions of switches (transistors) either that are on or off, designers of computers adopted a base 2 number system (binary).
A switch in the ON position can be represented by a 1 and a switch in the OFF position can be represented by a 0. Every computer system, at machine code level, reads and acts upon thousands of binary digits (bits) millions of times.
Convert 147 to binary.
10010011
Convert 10101101 to denary.
173
What is the difference between one’s complement and two’s complement?
There are a number of methods we can use to represent both positive and negative numbers. In one’s complement, each digit in the binary number is inverted (in other words, 0 becomes 1 and 1 becomes 0) In two’s complement, each digit in binary is inverted and a ‘1’ is added to the right-most bit - which removes a lot of problems that one’s complement encounters
Add 00100101 and 00111010 using two’s complement binary
95
Add 01010010 and 01000101. What is the result and why does this occur?
In this case, we get the answer of -105, which is incorrect for this calculation. This is known as overflow error, which occurs when there are not enough available bits to accurately represent the number we want.
Subtract 68 from 95 in binary (two’s complement)
00011011
What differences are there between a kibibyte and a kilobyte?
A kilobyte is a unit of memory equal to 1000 bytes. A kibibyte is the equivalent of 1024 bytes. A kilobyte uses the base 10 SI number system which makes carrying out calculations simpler (multiples of 10). A kibibyte uses base 8 system proposed by IEC. This system means that larger binary figures are more accurate.
How many bytes are there in a megibyte?
1024x1024 bytes
Convert 10111001 (binary) into its hexadecimal equivalent.
B9
What is Binary Coded Decimal (BCD), and what is it used for?
A binary system that uses 4 bit codes to represent each denary digit. Digits can be stored either as a a single 4-bit code or two 4-bit codes to form a byte.
One use of BCD is when denary numbers need to be electronically coded
e.g. to operate displays on a calculator where each digit is represented this allows decimal fractions can be accurately represented with 4 bits per digit
What is hexadecimal?
Base 16 number system, that uses numbers 1-9, and letter A-F to represent 10-16. Hex is often used by programmers when developing software or error checking using memory dumps. 1 hex digit is the equivalent of 4 binary digits, which makes reading long strings of numbers easier; less prone to human error.
What is BCD error correction?
When the result of a BCD calculation exceeds a single digit denary number (e.g. 10, 11) the answer will be incorrect; as a 2+ digit denary number cannot be encoded using only 4 BCD digits.
To solve this problem and enable the computer to store monetary values accurately, is to add 0110 (6 in denary) when such a problem arises. The computer can be programmed to recognise this issue and add 0110 at each appropriate point.
What is ASCII?
ASCII, American Standard Code for Information Interchange, is a character encoding standard for electronic communication. This character set uses 7 bits (giving 0-127 spaces or 0-7F in hex) to represent each character, letter, number in the english language.
What is extended ASCII?
Extended ASCII uses 8-bit codes (adding 128 to 255 in denary or 80-FF in hex characters to standard ASCII). This allows for non-English characters and other special characters to be included.