Lecture 1B: Positional Numbering Systems Flashcards

1
Q

Name the most popular Positional Numbering Systems (PNS).

A

Decimal, Binary, Octal, Hexadecimal.

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

What PNS is Base-2?

A

Binary

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

What PNS is Base-10?

A

Decimal

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

What PNS is Base-16?

A

Hexadecimal

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

What PNS is Base-8?

A

Octal

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

How do you convert Decimal to Binary?

A
  1. Divide decimal by 2.
  2. Write down the quotient and the remainder.
  3. Divide quotient by 2.
  4. Write down the quotient and the remainder.
  5. Repeat the process (1)-(4) until the quotient becomes zero.
  6. Write down the binary number from the bottom (MSB) to top (LSB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Decimal 66 in Binary?

A

100010

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

How do you convert Decimal to Hexadecimal?

A
  1. Divide decimal by 16.
  2. Write down the quotient and the remainder.
  3. Divide quotient by 16.
  4. Write down the quotient and the remainder.
  5. Repeat the process (1)-(4) until the quotient becomes zero.
  6. Write down the hexadecimal number from the bottom (MSB) to top (LSB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Decimal 524 in Hexadecimal?

A

20C

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

How do you convert Binary to Octal?

A
  1. Start from the right to make your groups.
  2. Add zeros to the left of the last digit if you don’t have enough to make a set of three.
  3. Write down the decimal representation of every group.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Binary 101011 in Octal?

A

53

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

How do you convert Binary to Hexadecimal?

A
  1. Cut your string of binary numbers into groups of four, starting from the right.
  2. Add extra zeros to the front of the first number if required.
  3. Convert one 4-digit group at a time. To convert between binary and hexadecimal, you simply replace each hexadecimal digit with its 4-bit binary equivalent and vice versa.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Binary 10001101011 in Hexadecimal?

A

46B

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

How do you convert Hexadecimal or Octal to Binary?

A

• Look up each hex or octal digit to obtain the equivalent group of four binary digits.

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

What is Hexadecimal 8B.2 in Binary?

A

10001011.0010

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

What is Octal 317.2 in Binary?

A

11001111.01

17
Q

What are the advantages of Signed Magnitude Representation?

A

It is easy for people to understand.

18
Q

What are the disadvantages of Signed Magnitude Representation?

A

It is hard for computers to process.
It requires complicated computer hardware.
It allows two different representations of zero - positive zero and negative zero.

19
Q

Which bit in a Signed Magnitude Representation is the sign bit?

A

Most significant / leftmost bit.

20
Q

What are two possible sign bits in Signed Magnitude Representation?

A

1 for positive and 0 for negative.

21
Q

How do you represent a negative value in One’s Compliment?

A

Invert all the bits in the binary representation of the number. 1 becomes 0 and 0 becomes 1.

For example:
+3 is 00000011
-3 is 11111100

22
Q

What are the disadvantages of One’s Complement?

A

It has two different representations for zero: positive zero and negative zero.
Positive and negative integers need to be processed differently.

23
Q

How do you represent a negative number in Two’s Compliment

A

First, convert the number to one’s complement, then add 1 using binary arithmetic.
• You represent positive numbers just like unsigned numbers.
• To represent negative values, start with the corresponding positive number, invert all bits then add 1.

For example, using two 8 bit two's complement representation:
\+3 is 00000011 (One's Compliment)
-3 is 11111100 (One's Compliment)
then +1
-3 is 11111101 (Two's Compliment)
24
Q

How do you represent a negative number in Two’s Compliment

A

First, convert the number to one’s complement, then add 1 using binary arithmetic.
• You represent positive numbers just like unsigned numbers.
• To represent negative values, start with the corresponding positive number, invert all bits then add 1.

For example, using two 8 bit two's complement representation:
\+3 is 00000011 (One's Compliment)
-3 is 11111100 (One's Compliment)
then +1
-3 is 11111101 (Two's Compliment)
25
Q

How can you check if two’s complement is correct?

A

By adding the two numbers. The result has to be zero.

Note that the result of the addition must be of the n bits, where n is the number of bits in the inputs.

26
Q

How can you multiply a signed integer?

A
  • Simply use an arithmetic shift operation.
  • A left arithmetic shift inserts a zero in for the rightmost bit and shifts everything else left one bit; in effect, it multiplies it by 2.
27
Q

How can you divide a signed integer?

A
  • Simply use an arithmetic shift operation.

* A right arithmetic shift shifts everything one bit to the right, but copies the sign bit; it divides by 2.

28
Q

How many bits are used in single and double floating-point representations?

A

Single: 32-bit
Double: 64-bit