Binary Numbers and Integer Representations Flashcards

1
Q

Binary Number Features

A

Are base 2 numbers / Use binary digits (bits) 0 and 1 / Easy to encode on a computer, since only 2 states need to be distinguished / Binary numbers are encoded using 1 or more bits in combination

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

How many bit patterns can be held by an N-bit register

A

2^N (e.g. 4bit register can hold 16 distinct bit patterns)

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

How are unsigned integers encoded?

A

Using binary numbers

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

What is the range for binary numbers

A

0 to 2^N -1

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

How are signed integers encoded?

A

Using two’s complement representation

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

What is the range for two’s complement representation?

A

-2^(N-1) to +2^(N-1)-1

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

How can a number be negated (2’s complement)

A

Take the one’s complement 0(Reverse 0s and 1s) / Add 1 to the result

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

All positive numbers have a _ in the sign-bit (left-most bit)

A

0

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

All negative numbers have a _ in the sign-bit (left-most bit)

A

1

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

Are sign-magnitude and one’s complement representations possible?

A

Yes but they are awkward to handle in hardware, have two 0s (-0 and +0)

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

Hexadecimal conversion table (base 16)

A

Screenshot

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

What is the prefix for Hex. #s?

A

0x

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

What are Octal numbers used for?

A

They are used as a shorthand for denoting bit patterns / Each digit corresponds to a 3-bit pattern e.g. 0756

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

What is the prefix for Oct #s

A

0

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

Linux on ARMv8 in AArch64 uses the ____ data model

A

LP64 (long integers and pointers are 64-bits long)

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

A64 Keyword / Size in Bits / C Keyword

A
17
Q

In c use the “________” keyword to denote unsigned integers

A
  • unsigned*
  • e.g. unsigned* int x;
18
Q
A