Number Representation - Steps to doing each one Flashcards

1
Q

Radix R -> Decimal

A

This is just a way to remember positioning. Given a number to any base the most righthand side is the lowest position 0 (if there are no decimals or looking at the integer part only). You simply just multiply the value in that position by the base to the power of the position. For example if we had 4321 base 5, the most righthand side is the lowest position and hence 1 is in position 0 to to find the value you do 1 * 5^0 = 1*1 = 1. You do the same for every value and then sum them together to get the value of the new base.

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

Decimal to Radix R

A

The is just the reverse of Radix R to Decimal, given a number in this case a number to base 10 convert it to a different base. We just divide by the base and record the remainder. Then reading from bottom to top that is the number of the base. For example 586 base 10 to base 5 divide 586 by 5 which will give you 117 remainder 1. Then take 117 divide by 5 which is 23 remainder 2. Keep going untill the answer is 0 ie in this example we eventually get to 4 divided by 5 = 0 remainder 4

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

Decimal -> Binary

A

Given a decimal number we simply divide it by the base 2 and recored the remainder, until you get the answer to 0 with some remainder (This is similar to Decimal -> Radix R). Then you read the values from bottom to top to get your binary number to base 2.

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

Binary -> Decimal

A

We use the understanding of Radix R positioning to find a decimal from binary. Again the most righthand side is the lowest position at 0. Once you find all the values, in this case it will be the 0 or 1 mulitplied by the base 2 to the power of the position, you then sum them together to get the decimal base 10

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

Decimal -> Hex

A

Giuven a decimal number wi simply just divide it by the base 16 until you get to the answer 0 with some remainder. You then read from bottom to top to get the hex value base 16. Note that once the remainder is greater than 9 it turns into letters from 10 to 15 represented by A to F respectively.

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

Hex -> Decimal

A

We use the understanding of Radix R positioning to convert hex into decimal. Again the most righthand side it the lowest position 0. You just do value * base 16 to the power of the position will give you a value and then you just sum them together to get the decimal value. As we know hex uses letter from 10 - 15 so make sure to convert them from the letters to digits when doing the multiplication.

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

Binary -> Hex

A

Four binary digits make up one hex digit, so group digits into sets of four starting from the righthand side. If there is less than 4 digits then just pad with zeros to make it four. Then just find the hex value of them by converting it to decimal. For example 101100 in binary we need to pad this with zeros to split it and then pad it with zeros, so now it looks like this 0010 1100 and then convert this to decimal. We know 0010 is 2 and 1100 is 12 therefore this is 2C in hex. (NOTE: It better to just remember all the binary values from 0 to 9 and A to F).

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

Hex -> Binary

A

Simply convert the Hex values into binary. This is essentially knowing each of the binary values from 0 to 9 and A to F

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

Radix R -> Decimal/Binary/Hex (Fixed Point)

A

Fixed point essentially means there is now a decimal point or a fraction added, ie ab.cd. This is the exact same as normal Radix R but now the fractions are negative powers to represent their position. For example if we had 10.10 base 2 (binary) and wanted to convert it to decimal base 10 we would take the integer side which is just 10 set out the positions and multiple as normal so 0 is in 0 position and 1 is in the 1 position. Now for the fraction you do the same thing but its now negative power so 0.10 or .10 the 1 is in the -1 position and 0 is in the negative 2 position.
!!!!!!
Now when it comes to the power we need to now 10^n, 2^n and 16^n
10^n is just shifting the decimal so if 10^1 = 1 then 10^-1 is 0.1, 10^-2 is 0.01,e tc
2^n is just halfing so if 2^0 = 1 then 2^-1 is 0.5, 2^-2 is 0.25, etc
16^n is just

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

Decimal/Binary/Hex -> Radix R (Fixed Point)

A

Going the opposite way is just the same thing as normal Radix R where we divide by the base and record the remainder adn then read from bottom to top. But for the fractions we actually multiply by the base and then read bottom to top.

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

Decimal -> Binary (Fixed Point)

A

Same as standard decimal to binary, but now for the decimals you must multiply by the base and record the number in front of the decimal point and then carry the fraction until a certain precision which you will be told. Read top to bottom

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

Binary -> Decimal (Fixed Point)

A

Same as standard binary to decimal except the fractions need to be multiplied by negative powers because of their position

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

Decimal -> Hex (Fixed Point)

A

Same as decimal to hex but for the fractions yu are multiplying the base and recording the value in front of the decimal point and carrying over the fraction to do it again until a certain precision. You are then reading from bottom to top to determine the value.

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

Hex -> Decimal (Fixed point)

A

Same as hex to decimal but again the positioning is now negative and hence the powers will all be negative. But you essentially do the same thing and then sum the values together. Note that the answer migh be different from decimal to hex due to extra precision.

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

Signed Hex -> Decimal

A

First note that Hex to decimal is unsigned. But for a signed hex you first need to convert the hex into binary (this also happens for a fixed point). We then need to invert the bits, this is where 1s become 0s and 0s become 1s. We then add + 1 to the inverted bits amd then either convert back to hex or from the binary figure out the decimal. Once that is done given that it is signed which means its negative you just a negative sign to the front.

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

Decimal -> Signed Hex

A

Given a negative decimal first convert to binary (this includes if there is a fixed point). We then make it 8 bits by padding it with 0 if necessary. We then invert the bits where 0s become 1s and 1s become 0s we then add 1 to the inverted bits (note that having 1001 on the end when adding the bit this just shifts the bit up one ie it becomes 1010) and then convert it back to hex.

17
Q

Signed Binary -> Decimal

A

First note that binary to decimal is unsigned, but if it state that its signed a 1 means its a negative value and a 0 means its a positive value. We first calculate the twos compliment which is just inverting the bits and then adding 1 to the least significant bit. We then find the value of the integer part by using positioning and then do the same for the fraction (in this case everything is base 2), we then add those together and then if its negative we add a negative sign to the front otherwise we just leave it as positive.

18
Q

Decimal -> Signed Binary

A

First determine whether it is negative or positive, if its negative ignore it and convert the interger value to binary by dividing by base to (as you would normally do). Do the same to the fraction if necessary. Then combine them, if the integer is missing bits (not a 4 bits per binary number) then pad with 0s. Then using the twos compliment invert the bits and add +1 to get the answer. Read top to bottom

19
Q

Floating Point -> Decimal

A

Given the formual (Refer to notes), first determine if the sign value either 0 or 1, then convert the exponent into a decimal number. Then look at the mantissaand add that to the fraction. Simplify the equation and look at the power value on the second part of the equation (2^exponent -127). this value tells you how much to shift the fraction value. If it is positive shift to the right, if it is negative shift to the left. Then using Radix R positioning find the values and sum them together.

20
Q

Decimal -> Floating Point

A

First convert it to binary and then combine it together. Normalise it in the form a.x * 2^n, where a is the value in front of the decimal point, x become the mantissa and n is the number of shifts needed to normalise from the initial decimal point. then find the determine the exponent by adding the shift value n to 127 and then represent it in binary (by dividing by 2). Then contruct it. Look at the the decimal value and see its it negative or positive and put down either a 0 or 1. Then add the exponent you found in binary, and then add the mantissa which was x (everything after the decimal when we normalised it). Pad the mantissa with 0s if necessary.