Integer representation and arithmetic pt1 Flashcards

1
Q

What is a bit

A

A bit is a single binary digit, i.e., 0 or 1

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

What is a byte

A

A byte is an 8-element sequence of bits

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

What is a word

A

A word is a w-element sequence of bits

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

How does binary relate mathematically to integers

A

Mapping representation

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

What is little-endian ordering for bit sequences?

A

Least sig value stored first

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

What is big-endian ordering?

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

Which bit-sequence ordering is used most often? And why?

A

Little-endian (right-to-left)
Because it makes it such that the least sig bit is at the start (great for operating on it)

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

How do single binary operators apply to a string of bits

A

Applies to each element (eg not)

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

How do multi-binary operators (eg: AND OR XOR etc.) apply to two strings of bits

A

Applies to each element combined (make sure to pad with zeros on sig side)

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

What is the Hamming weight of a string of bits

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

What is the Hamming distance of two strings of bits

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

How does base expansion of a string of digits work

A

Multiply by base to the power of index (in little endian). Eg 2^0 2^1 etc.

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

How to convert between hexadecimal string and a binary string

A

Each hex character represents 4 bits so can expand

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

How does a binary left (or right) shift work

A

For left shift multiply by 2^y (or inverse for right shift)

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

How does the sign magnitude approach work

A
  • 1st bit is reserved for the sign
  • Means that there is pos and neg zero
  • Smaller range than twos-compliment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does the sign magnitude number line look

A
17
Q

How does the twos compliment approach work

A
  • 1 at the start still signifies negative
  • 10000000 is the most sig negative value
  • Any additional 1 counts upwards
  • 1 more possible value since no pos neg zero
18
Q

What does the twos compliment number line look like

A
19
Q

How many states possible in an n bit word

A

2^n or max binary val of 2^n -1