Now, suppose you have the following two 8-bit hexadecimal numbers, both of which use two's complement: ef 4a
4. What is the decimal equivalent of each of these numbers?
6. What is their sum in hexadecimal? (Note that the sum must also be confined to 8 bits in order for two's complement to work.)
4)
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from hexadecimal to binary
Converting EF to binary
E => 1110
F => 1111
So, in binary EF is 11101111
EF in binary is 11101111
Converting 4A to binary
4 => 0100
A => 1010
So, in binary 4A is 01001010
4A in binary is 01001010
first = 11101111
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
11101111 is flipped to 00010000
II. Add 1 to above result
00010000 + 1 = 00010001
III. Now convert this result to decimal value
=> 10001
=> 1x2^4+0x2^3+0x2^2+0x2^1+1x2^0
=> 1x16+0x8+0x4+0x2+1x1
=> 16+0+0+0+1
=> 17
so, 11101111 in 2's complement decimal is -17
second = 01001010
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
=> 1001010
=> 1x2^6+0x2^5+0x2^4+1x2^3+0x2^2+1x2^1+0x2^0
=> 1x64+0x32+0x16+1x8+0x4+1x2+0x1
=> 64+0+0+8+0+2+0
=> 74
so, 01001010 in 2's complement decimal is 74
Answer: numbers in decimal are -17 and 74
6)
Adding 11101111 and 01001010 in binary
11101111
01001010
-------------
(1)00111001
-------------
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 00111001
Verification
---------------
sum = 00111001
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
=> 111001
=> 1x2^5+1x2^4+1x2^3+0x2^2+0x2^1+1x2^0
=> 1x32+1x16+1x8+0x4+0x2+1x1
=> 32+16+8+0+0+1
=> 57
This is correct since we can verify that -17+74 = 57
So, there was no overflow.
Now, let's convert the sum 00111001 back to hexadecimal
Converting 00111001 to hexadecimal
0011 => 3
1001 => 9
So, in hexadecimal 00111001 is 0x39
Answer: 0x39
Now, suppose you have the following two 8-bit hexadecimal numbers, both of which use two's complement:...
2. Convert the following two's complement binary numbers to decimal numbers. These numbers are integers. a. 110101 b. 01101010 c. 10110101 3. Convert the following decimal numbers to 6-bit two's complement binary numbers and add them. Write the results in 6-bit two's complement binary number format and decimal number format. Indicate whether or not the sum overflows a 6-bit result. a. 14 + 12 b. 30 + 2 C. -7 + 20 d. -18-17 4. What is the signed/magnitude and two's complement range of...
1. What is the largest decimal number we can represent with a 16 bit two's complement number? 2. Convert the following signed binary numbers to decimals. 11001 010011 1110100 1100111 3. Convert the following decimal numbers to 6-bit two's complement binary numbers and add them. Note if there is an overflow. 7 + 13 Two's complement/binary number for 7: Two's complement/binary number for 13: Sum: Overflow? 4. Convert the following decimal numbers to 6-bit two's complement binary numbers...
Chapter 1. problem 7: (5+5 pts)Tbe following 6-bit two's complement numbers were found in a computer. What decimal number do they represent'? f) 111001 Chapter 1.problem 9: (10 pts) Each of the following pairs of signed (two's complement) integers are stored in computer words (6 bits). Compute the sum as it is stored in a 6-bit computer word. Show the decimal equivalent of each operand and the sum. Indicate if there is overflow a) 110101 001111
(5 points) Convert the following decimal numbers to 8-bit two's complement binary numbers and carry out the additions in binary. Indicate whether the sum overflows the 8-bit result. If not show the result as a decimal number. a) 39 + (-78) b) -43 + (-92)
5. Express (76) 10 and (-114)10 in 8-bit binary two's complement arithmetic and then add the numbers. What would be the representation (0)10 in 16-bit binary two's complement? (be sure to show your work). 6. Create two 16-bit 2's complement integer such that their sum causes an overflow. Why does the sum of a negative 2's complement number and a positive 2's complement number never generate an overflow? Discuss.
Suppose you have two 8-bit registers, A and B. containing signed two's complement values A contains the value 11001110 B contains the value 11111010 What is the decimal value of the difference between them (A - B)?
6. Convert the following 8-bit two's complement notation into base ten numbers. (8 points) a. 00011110 b. 11110100
Suppose you have two 8-bit registers, A and B. A contains the value 11001100 B contains the value 01001111 What is the decimal value of the two's complement binary sum?
Do the following number conversions assuming two's complement representation is used for binary numbers. Douto check your answers becauses mentioned in class.portul credt will not be please digit is wrong in your answer. Do not put any space between ages/bits in your answers a. (113710 - 02 (8-bit binary number) b. (-97)10 - 12 (8-bit binary number) C. (0101 11002 D10 (decimal number) d. (1010 00112 010 (decimal number e. (3C7B)16 12 (16-bit binary number) f. (0100 1011 1000 1110)2-(...
UDP and TCP use 1s complement for their checksum. Suppose you have the following two 8-bit bytes: 0101, 1010. What is the 1s complement of the sum of these 8-bit bytes? Suppose the two bytes are altered during transmission with the checksum as follows: 1001, 0110. Can the checksum be used to detect the alteration?