3) Convert following decimal to 8-bit signed numbers in hexadecimal, use two’s-complement for signed integer
127d, -20d, -128d, -1d
4) Convert the 16-bit signed numbers to the decimal
C0A3h, 3AECh, 0101 1001 0111b, 1011 0101 1001 0111b
please solve the problems step by step. It would be of great help.
If you need any corrections or clarifications kindly comment
Please give a Thumps Up if you like the answer.
3) Convert following decimal to 8-bit signed numbers in hexadecimal
Steps for converting decimal to hexadecimal number(unsigned numbers):
Start dividing the decimal number by 16.
Note down the remainder in decimal and in hexadecimal.
Again divide the quotient by 16.
Repeat step 2 and 3 until quotient is equal to 0.
The hexadecimal value is the sequence of the remainders in hex from the last to first.
HEXADECIMAL |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
DECIMAL |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
a) 127 d=7F in hexadecimal
DIVISION |
RESULT |
REMAINDER |
REMAINDER |
127 / 16 |
7 |
15 |
F |
7/ 16 |
0 |
7 |
7 |
ANSWER |
7F |
Steps for converting signed decimal to hexadecimal
First convert the decimal number to two's complement signed binary.
Then convert that binary value to hexadecimal.
b) -20d
Step1: Convert 2010 to binary:
Division |
Quotient |
Remainder |
Bit # |
---|---|---|---|
20/2 |
10 |
0 |
0 |
10/2 |
5 |
0 |
1 |
5/2 |
2 |
1 |
2 |
2/2 |
1 |
0 |
3 |
1/2 |
0 |
1 |
4 |
So 2010 = 0101002
Fill the value to 16 bits by adding 10 leading zeroes on the left
Thus 2010 = 0000 0000 0001 01002
Step2: Convert to 1’s complement by inverting the bits
Result=1111 1111 1110 1011
Step 3: Find 2’s complement by adding 1 to the above result
Result=1111 1111 1110 1011+1=1111 1111 1110 1100
Step 4: Convert this binary value to hexadecimal. For that group the bits into groups of four, then convert each group to its hexadecimal equivalent
1111 1111 1110 1100b=FFEC in hexadecimal
b) -128d
Step1: Convert 12810 to binary:
Division |
Quotient |
Remainder |
Bit # |
---|---|---|---|
128/2 |
64 |
0 |
0 |
64/2 |
32 |
0 |
1 |
32/2 |
16 |
0 |
2 |
16/2 |
8 |
0 |
3 |
8/2 |
4 |
0 |
4 |
4/2 |
2 |
0 |
5 |
2/2 |
1 |
0 |
6 |
1/2 |
0 |
1 |
7 |
So 12810 = 1000 00002
Fill the value to 16 bits by adding 8 leading zeroes on the left.
Thus 12810 = 0000 0000 1000 00002
Step2: Convert to 1’s complement by inverting the bits
Result=1111 1111 0111 1111
Step 3: Find 2’s complement by adding 1 to the above result
Result=1111 1111 0111 1111+1=1111 1111 1000 0000
Step 4: Convert this binary value to hexadecimal. For that group the bits into groups of four, then convert each group to its hexadecimal equivalent
1111 1111 1000 0000=FF80 in hexadecimal
d) -1d
Step1: Convert 110 to binary:
Division |
Quotient |
Remainder |
Bit # |
---|---|---|---|
1/2 |
0 |
1 |
0 |
So 110 = 12
Fill the value to 16 bits by adding 15 leading zeroes on the left
Thus 110 = 0000 0000 0000 00012
Step2: Convert to 1’s complement by inverting the bits
Result=1111 1111 1111 1110
Step 3: Find 2’s complement by adding 1 to the above result
Result=1111 1111 1111 1110+1=1111 1111 1111 1111
Step 4: Convert this binary value to hexadecimal. For that group the bits into groups of four, then convert each group to its hexadecimal equivalent
1111 1111 1111 1111b=FFFF in hexadecimal
4) Convert the 16-bit signed numbers to the decimal
a. C0A3h=49315d
Ch=12d
Ah=10d
C0A3=12*163+0*162+10*161+3*160
=12*4096+0+10*16+3*1
=49152+0+160+3
=49315
b. 3AECh=15084d
Ch=12d
Eh=14d
Ah=10d
3AEC=3*163+10*162+14*161+12*160
=3*4096+10*256+14*16+12*1
=12288+2560+224+12
=15084
c.0101 1001 0111b=1431d
0101 1001 0111=(0*211)+(1*210)+(0*29)+(1*28)+(1*27)+(0*26)+(0*25)+(1*24)+(0*23)+(1*22)+(1*21)+(1*20)
=0+1024+0+256+128+0+0+16+0+4+2+1
=1431
d.
1011 0101 1001 0111b=46487d
1011 0101 1001 0111b=
(1*215)+(0*214)+(1*213)+(1*212)+(0*211)+(1*210)+(0*29)+(1*28)+(1*27)+(0*26)+(0*25)+(1*24)+(0*23)+(1*22)+(1*21)+(1*20)
=32768+0+8192+4096+0+1024+0+256+128+0+0+16+0+4+2+1
=46487
3) Convert following decimal to 8-bit signed numbers in hexadecimal, use two’s-complement for signed integer 127d,...
Convert -11310 to an 8-bit two’s complement binary integer. Please explain the steps.
Assume that 151 and 214 are signed 8-bit decimal integers stored in two’s complement format. Calculate 151 + 214 by adding the two’s complement numbers first and then writing the final result in decimal. Then explain why the final result is very different from 366 (151+214=366). Note that if a number requires more than 8 bits, you need to represent first the number correctly using as many bits as necessary, then keep only the 8 bits, and use the resulting...
1.Convert the following decimal and binary numbers into signed integer 32-bit representation (2’s complement for negative numbers). -99
Can anyone please help me convert the Two’s Complement hexadecimal number 0x8213 ABCD to a decimal ? Thank you!
3. What is the hexadecimal representation of each of the following binary numbers in signed 2’s complement? 0010 0101 0100 0011 0001 1011 0010 0100 1111 0110 1101 1001
Convert the decimal numbers A and B to 5-bit binary numbers. Using two’s complement representation, show (i) how to subtract the two 5-bit binary numbers (A−B); (ii) how to translate the binary result back to decimal
Convert the following numbers from binary to decimal, assuming nine-bit two’s complement binary representation: 1 0110 1010
Exercise 1.25 Convert the following decimal numbers to unsigned binary numbers Exercise 1.31 Repeat Exercise 1.29, but convert to 8-bit sign/magnitude numbers KExercise 1.32 Repeat Exercise 1.30, but convert to 8-bit sign/magnitude numbers (a) 4210 (b) 6310 Exercise 1.33 Convert the following 4-bit two's complement numbers to 8-bit two's complement numbers. (c) 22910 (d) 84510 (a) 0101 b) 1010 XExercise 1.26 Convert the following decimal numbers to unsigned binary numbers. Exercise 1.34 Convert the following 4-bit two's complement numbers to...
Convert the following 8-bit twos-complement numbers to signed decimal numbers. (a) 00000001 (c) 1 9-6 (b) 10010000 (d) 10000000
3. Convert the following signed hexadecimal numbers to decimal . a) EE2 b) 7F2 c) 2FE 4. Perform the subtractions with the following binary numbers using 2’s complement Check the answer by straight binary subtractions. a) 10011 – 10001, b) 10110 – 11000, c) 100111011 – 10001. 5. What is the decimal equivalent of the largest binary integer that can be obtained with a) 11 bits unsigned signed b) 25 bits? unsigned signed