6. Translate the following base 10 integers into binary, octal and hexadecimal.
ID: 668836 • Letter: 6
Question
6. Translate the following base 10 integers into binary, octal and hexadecimal. Show your work for the “grouping method” of translating binary to octal and hexadecimal. (6)
a. 244
b. 136
7. Show the 6 bit ones complement representation of the following numbers. Show your work. (10)
a. 27
b. -15
8. Add the two numbers in question 7 together using ones complement arithmetic. Show your work including carries. (8)
9. Show that your answer to 8 is correct by translating the ones complement sumto base 10. Show your work. (6)
10. Translate the following 6 bit twos complement numbers into base 10. Show your work. (9)
a. 110101
b. 011001
c. 100101
11. Translate the following base 10 numbers into 6 bit twos complement and perform the operation. Show your work including carries. (16)
a. 28
-16
---
b. -23
+ 8
---
Explanation / Answer
6. Convert the numbers 24410,, 13610 to binary octal and hexadecimal.
a. 24410 to binary:
At every step divide the number by 2, and store both the quotient and reminder.
Repeat the logic considering the quotient as the new number.
Repeat till you get a quotient of ZERO(0).
Quotient Reminder
122 0
61 0
30 1
15 0
7 1
3 1
1 1
0 1
collect the digits from bottom to top which will give the binary equivalent of given integer.
Therefore, 24410 = 111101002.
Converting a binary number to octal:
Divide the binary number into 3 digit groups starting from right.
Convert those numbers into octal each, by multiplying the number with 20*uintsvalue + 21*10’svalue + 22*100’s value.
11 110 100
3 6 4
Therefore, 24410 = 3648.
Converting a binary number to hexadecimal:
Divide the binary number into 4 digit groups starting from right.
Convert those number into hexadecimal, by multiplying the number with
20*uintsvalue + 21*10’svalue + 22*100’s value + 23*1000’s value.
1111 0100
15(F) 4
Therefore, 24410 = F416.
b. 13610 to binary:
Quotient Reminder
68 0
34 0
17 0
8 1
4 0
2 0
1 0
0 1
Therefore, 13610 = 100010002.
Converting a binary number to octal:
10 001 000
2 1 0
Therefore 13610 = 2108.
Converting a binary number to hexadecimal:
1000 1000
8 8
Therefore 136`0 = 8816.
7. 6-bit ones complement of the numbers 27 and -15.
a. Converting 2710 to binary:
Quotient Reminder
13 1
6 1
3 0
1 1
0 1
Therefore 2710 = 0110112
One’s complement of a given binary number is simple, replacing every occurrence of 0 in the binary number with 1, and replacing every occurrence of 1 in the binary number with 0. This is complementing.
Therefore ones complement of 0110112 = 1001002.
b. Converting -1510 to binary:
To convert a negative number to binary:
First convert the positive number, and then 2’s complement the binary number which will give the binary equivalent of given negative number.
2’s complementing of a number is simply doing the one’s complement and add 1 to that result.
Quotient Reminder
7 1
3 1
1 1
0 1
Therefore 1510 = 0011112.
Ones complement of 001111 is 110000.
Two’s compelement of 001111 is 110001.
Therefore -1510 = 1100012..
Finally ones compelement of 1100012 = 0011102..
8. Add the number 27 and -15 using ones complement arithmetic.
2710 = 0110112.
1510 = 0011112.
Ones complement arithmetic:
To add a positive number and negative binary number:
+ 27 = 011011
- 15 = -001111 110000 (Ones complement of 15)
Adding both these: 001011 with a carry of 1.
Adding the carry to the LSB:
001011
+ 1
001100
Therefore 2710 + -1510 result in binary format is: 0011002.
9. Converting the result in the previous answer(0011002) to base 10.
0*20 + 0*21 + 1*22 + 1*23 + 0*24 + 0*25 = 0+0+4+8+0+0 = 1210.
27 – 15 = 12. Which proves the answer.
10. Converting the 2’s complement numbers to base 10:
To convert a 2’s complement number to base 10:
a. 110101.
Ones complement is: 001010.
Adding one to this: 001011.
Converting to binary: 1+2+8 = 11 and adding a negative sign.
Therefore decimal equivalent of 2’s complement (110101) is -11.
b. 011001.
Ones complement is: 100110.
Adding one to this: 100111.
Converting to binary: 1+2+4+32= 39 and adding a negative sign.
Therefore decimal equivalent of 2’s complement (011001) is -39.
c. 100101.
Ones complement is: 011010.
Adding one to this: 011011.
Converting to binary: 1+2+8+16 = 27 and adding a negative sign.
Therefore decimal equivalent of 2’s complement (100101) is -27.
11. Converting the given decimal numbers to into 6-bit 2’s complement and perform the arithmetic operations:
a. 28 – 16:
Converting 2810 to binary:
Quotient Remainder
14 0
7 0
3 1
1 1
0 1
2810 = 0111002
2’s complement of this number is: 100011(1’s complement) + 1 = 100100.
Converting 1610 to binary:
Quotient Remainder
8 0
4 0
2 0
1 0
0 1
1610 = 0100002.
2’s complement of this number is: 101111(1’s complement) + 1 = 110000.
+28 = 011100
-16 = -010000 101111 (Ones complement of 16)
Adding both these 001011 with a carry of 1.
Adding the carry to the LSB:
001011
+ 1
001100
Therefore 2810 + -1610 result in binary format is: 0011002.which is (12).
b. -23 + 8.:
Converting 2310 to binary:
Quotient Remainder
11 1
5 1
2 1
1 0
0 1
2310 = 0101112
2’s complement of this number is: 101000(1’s complement) + 1 = 101001.
Converting 810 to binary:
Quotient Remainder
4 0
2 0
1 0
0 1
810 = 0010002.
2’s complement of this number is: 110111(1’s complement) + 1 = 111000.
-23 = -010111 101000 (Ones complement of 23)
8 = 001000
Adding both these 110000.
When subtracting the larger number from smaller number, just ones complement the result and convert that to binary with negative sign before.
Therefore ones complement of result is: 001111
Therefore -2310 + 810 result in binary format is: -0011112. which is (-15)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.