Binary Arithmetic Flashcards

1
Q

What symbols does the binary number system use?

A

It uses 2 symbols: 0 and 1

eg. 19 in binary is 10011

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

What is the right-most digit called?

A

Least Significant Bit (LSB)

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

What is the left-most digit called?

A

Most Significant Bit (MSB)

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

What is the highest number that we can represent in binary with N digits?

A

2N - 1

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

What does Q3 format mean?

A

It has 3 bits after the binary point (binary equivalent of decimal point)

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

How do you convert from decimal to binary?

A

Do repeated division by 2 until you get 1. The remainders are the bits starting from the LSB

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

What is a flag?

A

A binary number only having 1 bit

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

What is a nibble?

A

A binary number having 4 bits

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

What is a byte?

A

A binary number having 8 bits

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

What is a word?

A

A binary number having 16 or more bits

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

How do you carry out binary addition?

A
110 + 101
Going from LSB
0+1 = 1, carry out = 0
1+0 = 1, carry out = 0
1+1 = 0, carry out = 1
SUM = A=OB
C = A.B
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the half adder do?

A
  • Generates the sum and carry-out for one column of an addition sum
  • BUT it does not allow for a carry-in from a previous column (this can be done with a full adder circuit)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe how a full adder works

A
  • The full adder uses 2 half adders; one to form the sum of A and B and another to add any carry in to this intermediate sum.
  • If EITHER of the two additions generates a carry-out, we must indicate that by setting the final carry out to 1.

[HALF ADDER then HALF ADDER then OR gate]

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

How do you built a multi-bit full adder?

A
  • A row of N full adders would be required and the result has to be (N+1 bits in the case of overflow).
    (this is catered for by carry out being the MSB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you represent negative numbers in binary?

A

2’s complement

[Half the possibilities for positive numbers and negative numbers, let the MSB have a negative weighting}

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

How do you differentiate between positive and negative signed numbers?

A
  • Signed numbers are positive if the MSB is 0

- Signed numbers are negative if the MSB is 1

17
Q

How do you carry out binary subtraction using 2’s complement?

A

1) Invert all the bits (eg. 0011 turns to 1100)
2) Add 1 (1100 + 1 = 1101)

NOTE: doesn’t work for the maximum negative number

18
Q

Calculate 4 minus 3 in binary

A

Convert to binary
4 = 0100
3 = 0011

Convert negative number to 2’s complement
-3 = 1101

Perform binary addition
0100 + 1101 = 10001

Discard carry out
=0001 (final answer)

19
Q

How do you prevent overflow when adding two N-bit signed numbers?

A

1) Sign extend to N + 1 bits

2) Use an N + 1 bit adder

20
Q

How do you extend a number of have more bits in signed binary?

A

Duplicate the MSB

eg.
- Converting 0011 into 8 bits gives 00000011
- Converting 1011 into 8 bits gives 11111011

This is called signed extension

21
Q

How do you build a subtraction machine?

A

Use an array of full adders but before that, pass all the B-input bits through inverters.
Then set the carry-in to 1 on the least significant full adder.

22
Q

What is a use of XOR gates?

A

They can be used as controllable inverters

23
Q

What is the difference between Unsigned and Signed values?

A

Unsigned

  • MSB has a positive value
  • The carry out from the MSB of an adder can be used as an extra bit of the answer to avoid overflow
  • To increase the umber of bits, add zeros to the left hand side
  • Complementing and adding 1 converts X to (2N - X)

Signed

  • MSP has a negative value
  • To avoid overflow, we need to sign extend then use and adder with one more bit than the numbers to be added
  • TO increase the number of bits, sign extend by duplicating the MSB
  • Complementing and adding 1 converts X to - X