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)

1
Q

What do computers use binary to do?

A
  • To represent data, such as numbers, text, sound and graphics
  • To program instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is 4 bits known as?

A

A nibble

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is 8 bits known as?

A

A byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

(Exam-style question)

Explain one reason why all instructions and data used by a computer are represented in binary. (3)

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

(Exam-style question)

Describe a ‘bit’. (2)

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

(Exam-style question)

Give one reason why a computer doesn’t need to know what a binary pattern represents. (1)

A

The microprocessor hardware only operates on bits, so it has no concept of type or representation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(Exam-style question)

Write an arithmetic expression to show that 256 different colours can be represented in 8 bits. (1)

A

2⁸ = 256 colours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can denary numbers also be called?

A

Decimal numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

(Exam-style question)

Explain one reason why the denary number 256 cannot be represented in an 8-bit binary pattern. (2)

A
  • The number would be represented in binary as 100000000
  • You would need 9 bits to store it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Convert the following denary numbers into 8-bit binary numbers:

a) 203
b) 241
c) 79
d) 100

A

a) 11001011
b) 11110001
c) 01001111
d) 01100100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Convert the 8-bit binary pattern 11011001 into a denary number.

A

217

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List two ways of representing signed integer numbers.

A
  • Two’s complement
  • Sign and magnitude
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What happens if the most significant bit of a two’s complement or sign and magnitude pattern is 1?

A

The number will have a negative value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

(Example)

Convert -10 to binary two’s complement.

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

(Exam-style question)

Convert the denary number -54 to 8-bit binary two’s complement representation. (3)

A

11001010

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

(Exam-style question)

Give the denary value of the 8-bit two’s complement number 11101111. (3)

17
Q

(Exam-style question)

Convert the denary number -94 to a binary pattern using sign and magnitude representation. (2)

18
Q

(Exam-style question)

Give the result of adding 00101011 and 00010111. (2)

19
Q

(Exam-style question)

Add the following 8-bit binary numbers:

01010111 + 01011111

Give your answer in 8-bit binary form. (2)

20
Q

(Exam-style question)

Give the result of applying a logical shift left, 2 places, to the 8-bit binary pattern 00010100. (1)

21
Q

(Exam-style question)

Give the result of applying a logical shift right, 3 places, to the 8-bit binary pattern 10111000. (1)

22
Q

(Exam-style question)

Give the result of applying an arithmetic shift right, 1 place, to the 8-bit binary pattern 10001000. (1)

23
Q

(Exam-style question)

Give the result of applying an arithmetic shift left, 1 place, to the 8-bit binary pattern 11101100. (1)

24
Q

(Exam-style question)

Describe one difference between a logical and an arithmetic shift. (2)

A
  • An arithmetic shift preserves the most significant bit
  • A logical shift always fills the vacated bits with 0s
25
# **(Exam-style question)** The binary bit pattern 10101101 is equal to the denary number 173. Explain the effect of performing a logical shift right of two places on the binary number 10101101, and state the denary number equivalent after the shift. (3)
* The binary number becomes 00101011 after the two-place logical right shift * The new binary number's denary equivalent is 43 * In a two-place logical right shift, the binary number is divided by 4; the result of dividing 173 by 4 is 43.25. * The right shift produces an imprecise result because it discards the two bits on the right of the binary number, effectively rounding it down to the nearest whole number
26
What happens to a binary number that has been shifted right one place?
It has been divided by 2
27
What type of binary numbers do arithmetic shifts operate on?
Two's complement binary
28
What type of binary numbers do logical shifts operate on?
Sign and magnitude binary
29
# **(Exam-style question)** Define the term 'overflow'. (2)
An error that occurs when a calculation produces a result that is greater than what the computer is able to store, or is greater than the number of bits available to store it
30
# **(Exam-style question)** State two consequences of an overflow error. (2)
* The program might crash * Continued use of an incorrect result in calculations will cause further errors
31
# **(Exam-style question)** Explain one reason why the result of adding two 16-bit binary patterns together must be 16 bits in length. (2)
The registers inside the machine that hold the original patterns have a fixed length, so they cannot hold more than 16 bits
32
# **(Exam-style question)** Describe one way an overflow error can be caused by shifting the 8-bit binary pattern 11000011 left by one position. (2)
* Shifting left the original pattern 11000011 gives 10000110 * The original 1 in the most significant bit is shifted out, therefore it uses a position that does not exist in the register
33
# **(Exam-style question)** Convert the 8-bit binary number 10110111 to hexadecimal. (1)
B7
34
# **(Exam-style question)** Convert the hexadecimal number E9 to 8-bit binary. (1)
11101001
35
What are some of the uses of hexadecimal notation?
* Used to help people deal with long binary digits as they are much shorter in hexadecimal * Error code numbers are usually given in hexadecimal when a computer malfunctions * Used to represent numerical values in assembly language
36
What is the number of bits true colour uses to code every available colour variation?
24 bits
37
Each colour is represented by three 8-bit binary numbers that can be simplified to three 2-digit hexadecimal ones. What is the benefit of this?
It is much easier to remember and enter the six digits of the hexadecimal number
38
# **(Exam-style question)** Explain why hexadecimal numbers are sometimes used to represent values stored in computers, even though computers do not use hexadecimal numbers. (2)
* Large binary numbers can be complicated to read and work with * Binary numbers can be simplified by writing them in hexadecimal as fewer numbers are needed, making them easier to read and memorise
39
What base are hexadecimal numbers in?
Base 16