Computer Systems (II) - Data Representation Flashcards
How do computers represent the flow of electricity?
1s and 0s
1 – electricity flowing
0 – electricity not flowing
What is a 0 or 1 in a binary code?
Each 0 or 1 in a binary code is a bit (binary digit)
How many bits is the binary code 1010?
4 bits
What is a byte big enough to store?
A byte can store one character (e.g. A, 1, £ etc…)
What two values can a bit take?
A 1 or a 0
Draw a table to represent the size of units of data
How many bits is a nibble?
4 bits
How many different values can a nibble take?
2 to the power 4 = 16x different values
How many different values can a byte take?
2 to the power 8 = 256x different values
How many bits are in a byte?
8 bits are in a byte
How many kB are in a B, MB in a kB, GB in a MB, TB in a GB and PB in a TB?
1000
*Units are sometimes defined as 1024 not 1000 as 1024 is a power of 2 which is helpful when dealing with binary
What base in binary?
Base 2 (binary)
What is our standard number system?
Denary (or decimal / base 10)
E.g. 0,1,2,3,4,5,6,7,8,9
In denary, what increase exists for the place value from right to left?
Powers of 10 (1000, 100, 10, 1)
In binary, what increase exists for the place value from right to left?
Powers of 2 (8, 4, 2, 1)
What are the binary equivalents of the denary 0-15?
0 = 0
1 = 1
2 = 10
3 = 11
4 = 100
5 = 101
6 = 110
7 = 111
8 = 1000
9 = 1001
10 = 1010
11 = 1011
12 = 1100
13 = 1101
14 = 1110
15 = 1111
What are most binary numbers given as?
8-bit numbers, e.g. 00110101
This can represent the denary numbers 0-256
The bit with the largest value of on what side?
The left-most bit
What is the left-most bit referred to as?
The most significant bit
What is the right-most bit referred to as?
The least significant bit
What does any non-zero number raised to the power 0 equal?
1
Draw out a table with binary place values to make a binary / denary conversion for the binary 00110101 and calculate the denary for this
00110101 = 53 in denary (add numbers with 1 in the column)
How can denary be converted to binary?
By subtracting (from largest to smallest)
Draw out a table to convert 79 into an 8-bit binary
79 = 01001111 in binary
How are binary numbers added together?
Column additions
What are the steps required for a binary addition?
Place the binary numbers into columns
Starting from the right, add numbers in the columns
When 1 + 1 = 10, carry the 1 into the next column
Add the binary numbers 10001101 and 01001000 together
In a binary addition if you come across 1 + 1+ 1 what should be done?
Write the 1, then carry 1 to the next column
Add the binary numbers 00110011 and 01111001 together
What causes an overflow error?
When a number has too many bits
E.g. 8-bit calculation 11111111 + 00000001 gives the 9-bit answer 100000000
The computer will see the 1 as an overflow error and return the result 00000000 – an overflow flag will be shown (storing the extra bits elsewhere)
What is a binary shift?
A binary / logical shift moves every bit in a binary number left or right (gaps are filled with a 0)
The direction of the shift indicates a multiplication or division
What is the difference between a left binary shift and a right binary shift?
A shift left multiplies and a shift right divides