Data representation Flashcards

1
Q

how many bits are in 1 byte?

A

8

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

how would you represent an unsigned integers in a n bit number?

A

raise 2 to the power of n - 1 finds the range of the possible numbers. (2^4 - 1 = 15 [0:16 = 16 different numbers)

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

how to convert a number from base b to base 10?

A

multiply each number in the base b by base b to the power of the position of the number in the number and total it up (e.g.1234^5 –> ?^10 = 1 * 5^3 + 2 5^2 + 3^5^1 + 45^0

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

how to convert a number from base 10 to base b?

A

divide the number by base b and put the remainders in the number starting from right to left, and keep dividing the result by base b until there are no more remainders

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

how to convert a number from base b to base c?

A

you would convert it from base b to base 10, and then from base 10 to base c

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

what do MSB and LSB refer to?

A

MSB refers to the most significant bit (far left digit) and LSB refers to the least significant bit (far right bit)

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

what is 6 in binary

A

0110

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

what is C in binary

A

1100

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

how to convert a hex to a decimal?

A

use the positional number system to multiply out each digit in the number by 16 to the power of n-1

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

how to convert a decimal to a binary number

A

divide decimal value by 2 until the value is 0, right remainders in the number from right to left

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

how to convert a binary number to octal

A

look @ the table and which value aligns with what binary number

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

how to convert an octal number into binary

A

write down the 3-bit binary code for each octal digit

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

how to convert a binary number to a hexadecimal?

A

group into 4 starting at the LSB and correlate each 4-bit binary code into either a number or a letter in hex

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

how to convert a hexadecimal to a binary number?

A

write down the 4-bit binary code for each hex digit

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

how can you tell if a number is positive or negative in signed magnitude

A

look for the sign bit in the MSB: if it is 0, its + but if its 1, its -

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

how to do one’s complement

A

invert the given number

17
Q

how to do two’s complement

A

invert the given number, add one

18
Q

how to do a logical right shift

A

move bits to the —> , same order, throw away the bit that comes off the LSB and introduce a 0 into the MSB

19
Q

how to do a logical left shift

A

move bits to the <—-, throw away the bit that pops off the MSB and tack on a 0 to the LSB

20
Q

how to do an arithmetic right shift

A

move the bits to the —>, throw away the bit that pops off, and reproduce the original MSB

21
Q

how to do an arithmetic left shift

A

move bits to the <—, throw away the bit that pops off the MSB and introduce a 0 into the LSB

22
Q

how to do a rotate left

A

move bits to the <—, put the bits that pop off the MSB into the LSB

23
Q

how to do a rotate right

A

move bits to the —>, put the bit that pops off the LSB into the MSB

24
Q

what does 2^-1 equal to?

A

negative exponent means its numerator: 1/2

25
Q

how would you find out the binary code of fractions from a given decimal value?

A

split the value into 2 parts: integer + fractional part. find the binary representation of the integer part by repeatedly divide the value and do the same for the fractional part but repeatedly multiply the value until you reach 0 as a product.

26
Q
A