1.1 Binary Hex Number Systems + Text Flashcards
Why do computers use binary to represent all forms of data?
- Any form of data needs to be converted to binary to be processed by a computer
- Data is processed using logic gates and stored in registers
Explain the concept of overflow and why it occurs in binary addition
- A computer or a device has a predefined limit that it can represent or store e.g. 16-bits
- Overflow errors happen when the largest number that a CPU register can hold is exceeded.
- The number of bits that a CPU can handle is called the word size.
- When adding 2 binary numbers an overflow error occurs when a value outside this limit is stored e.g if the value is greater than 255 in an 8-bit register
Explain the difference between the binary and denary number systems
- Binary base 2 system
- Denary base 10 system
- Binary has 2 digits (0 and 1)
- Denary has 10 digits (0-9)
- Binary place values are powers of 2
- Denary place values are powers of 10
What are the binary place values for a byte?
128 64 32 16 8 4 2 1
Convert the binary number 10011011 into denary
155
Convert the denary value 156 into binary
10011100
What is the largest value that can be stored in 8 bits?
255
What is the largest value that can be stored in 10 bits?
1023
What would be the effect of shifting the bits 1 place to the left for the binary value 0001 1101
- Multiplying by 2
- 0001 1101 = 29
- 00111010 = 58
What would be the effect of shifting bits 3 places to the left?
- multiply by 8 or multiply by 2 x 2 x 2 or multiply by 2^3
- 0000 0110 = 6
- 0011 0000 = 48
What would be the effect of shifting bits 2 places to the right?
- divide by 4 or divide by 2^2
- 0001 0000 = 16
- 0000 0100 = 4
How many bits in a byte?
8
How many bits in a nibble?
4
How many nibbles in 4 bytes?
8
What is a register?
- A register is a small amount of internal memory
- Used for fast reading and writing
- It is temporary/volatile (loses data once there is no power)
What are the rules you need to remmeber for binary addition?
- 0 + 1 = 1
- 1+ 1 = 2 = 0 Carry 1
- 1+1+1 = 3 = 1 Carry 1
Add the 2 binary values 00100111 + 01001010
01110001
Add the 2 binary values 01110010 + 11111001. If you tried to store the result in word size of 8 bits what error would occur?
Requires 9 bits (101101011) so overflow error
What are the binary place values for a 2’s Complement byte?
-128 64 32 16 8 4 2 1
What is the smallest value that can be stored in a 2’s Complement byte?
- -128 64 32 16 8 4 2 1
- 1 0 0 0 0 0 0 0= -128
What is the largest value that can be stored in a 2’s Complement byte?
- -128 64 32 16 8 4 2 1
- 0 1 1 1 1 1 1 1 = 127