Binary Representation Flashcards

1
Q

Bit

A

Bit: “Binary digiT,” a basic unit of information in a computer
○ 1 bit = a bit
○ 4 bits = a nibble
○ 8 bits = a byte

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

Digital

A

finite number of symbols (opposite is “analog” i.e. continuous)

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

Signed Magnitude

A

MSB tells sign of number. No further adjustments
001 = 1
101 = -1
Issue:
- two numbers for 0
- arithmetic not straight forward. Does not work.

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

1C

A

Flip all digits, to obtain negative of unsigned number
001 = 1
110 = -1

issue:

  • two numbers for 0
  • Hardware to perform addition is tricky to implement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

2C

A

1C + 1 to obtain negative of unsigned number.
Alternative approach: copy bits from right to left up to and including the first “1” and flip remaining bits
Advantage:
- only one representation for zero
- computer can add positive and negative numbers together

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

Floating Point

A

○ sign, fraction, and exponent
○ N = (-1) S × 1.fraction × 2^(exponent-127)
1__10000001__10101000000000000000000
S__Exponent__Fraction

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

Unsigned overflow

A

Operation results goes beyond the width of memory location in a computer/ width of machine

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

Signed overflow

A

positive + positive number -> negative

negative + negative number -> positive

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

ASCII - Size

A

2^7 = 128 combinations

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

UNICODE - Size

A

2^32 combinations

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

How do calculations with fractions in binary work

A

2C addtion and stubtraction still work. To do this, allign binary points

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

Word

A

bits computer can process in one operation

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

Multiplication of two n bit numbers. Result how many bits

A

2n

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

Addition of two n bit numbers. Result how many bits

A

up to n+1

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

Largest and smallest number that can be represented with n bits in 2C

A

Largest: 2^(n-1)-1
Smallest:-2^(n-1)

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

Sign Extension

A

Used when adding number of different length
Extend MSB of shorter number for 2C
Extend with 0 in case of unsigned numbers

17
Q

Encoding

A

Agreed upon ‘mapping’ of data from one representation to another
Examples: ASCII, UNICODE

18
Q

Hexadecimal

A

fewer digits. More compact and convenient than binary

Just a notation, not a different machine representation

19
Q

Why do we use bias ‘127’ in floating point standard

A
  • Allows us to have a very big range for the exponent from (-127 to 128)
  • allows us to represent very big an very small numbers w/o using 2c for the exponent
  • Allows us to speed up comparison of floating point numbers. –> Exponent is a 8 bit UNSIGNED number. Easier to compare then if we would need to convert in 2C. The “larger” the exponent number the bigger the number, negatively or positively depending on the Sign.
20
Q

Special Cases IEEE Floating point number

A

Number 0: Sign = X, Exponent = 0, Fraction =0
Number +Infinity: Sign = 0, Exponent = 11111111, Fraction =0
Number -Infinity: Sign = 1, Exponent = 11111111, Fraction =0
Number NaN: Sign = X, Exponent = 11111111, Fraction =Not Zero
Number: -1^s x 0.fraction x 2^(-126) . Case if exponent = 0 and fraction = not zero

21
Q

How many two input logic functions are possible?

A

4 input combinations. For every input combination I can assign 0 or 1 as output. i.e. 2^4 = 16