Binary Flashcards
(areas covered: using binary, unsigned integers, two's complement and sign and magnitude signed integers, binary addition, logical and arithmetic shifts, overflow, hexadecimal)
What do computers use binary to do?
- To represent data, such as numbers, text, sound and graphics
- To program instructions
What is 4 bits known as?
A nibble
What is 8 bits known as?
A byte
(Exam-style question)
Explain one reason why all instructions and data used by a computer are represented in binary. (3)
- A processor consists of billions of transistors, each having just two states, on/off
- The on/off states of a transistor represent the binary digits 1/0
(Exam-style question)
Describe a ‘bit’. (2)
- A bit is short for binary digit, the smallest unit of data in a computer
- A bit has a single binary value, either 0 or 1
(Exam-style question)
Give one reason why a computer doesn’t need to know what a binary pattern represents. (1)
The microprocessor hardware only operates on bits, so it has no concept of type or representation
(Exam-style question)
Write an arithmetic expression to show that 256 different colours can be represented in 8 bits. (1)
2⁸ = 256 colours
What can denary numbers also be called?
Decimal numbers
(Exam-style question)
Explain one reason why the denary number 256 cannot be represented in an 8-bit binary pattern. (2)
- The number would be represented in binary as 100000000
- You would need 9 bits to store it
Convert the following denary numbers into 8-bit binary numbers:
a) 203
b) 241
c) 79
d) 100
a) 11001011
b) 11110001
c) 01001111
d) 01100100
Convert the 8-bit binary pattern 11011001 into a denary number.
217
List two ways of representing signed integer numbers.
- Two’s complement
- Sign and magnitude
What happens if the most significant bit of a two’s complement or sign and magnitude pattern is 1?
The number will have a negative value
(Example)
Convert -10 to binary two’s complement.
- Write out the positive number (+10) in binary: 00001010
- Flip all the bits: 11110101
- Add 1 (00000001) to the result. This gives: 11110110
- Therefore, -10 in two’s complement is 11110110
(Exam-style question)
Convert the denary number -54 to 8-bit binary two’s complement representation. (3)
11001010
(Exam-style question)
Give the denary value of the 8-bit two’s complement number 11101111. (3)
-17
(Exam-style question)
Convert the denary number -94 to a binary pattern using sign and magnitude representation. (2)
11011110
(Exam-style question)
Give the result of adding 00101011 and 00010111. (2)
01000010
(Exam-style question)
Add the following 8-bit binary numbers:
01010111 + 01011111
Give your answer in 8-bit binary form. (2)
10110110
(Exam-style question)
Give the result of applying a logical shift left, 2 places, to the 8-bit binary pattern 00010100. (1)
01010000
(Exam-style question)
Give the result of applying a logical shift right, 3 places, to the 8-bit binary pattern 10111000. (1)
00010111
(Exam-style question)
Give the result of applying an arithmetic shift right, 1 place, to the 8-bit binary pattern 10001000. (1)
11000100
(Exam-style question)
Give the result of applying an arithmetic shift left, 1 place, to the 8-bit binary pattern 11101100. (1)
11011000
(Exam-style question)
Describe one difference between a logical and an arithmetic shift. (2)
- An arithmetic shift preserves the most significant bit
- A logical shift always fills the vacated bits with 0s