Question

In: Computer Science

Assuming integers are represented as 32-bit words and negative numbers are represented using the 2's complimentary...

Assuming integers are represented as 32-bit words and negative numbers are represented using the 2's complimentary method convert the following decimal numbers to hexadecimal numbers (show your work). a. -1314, b. 2020

Solutions

Expert Solution

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
using this table for converting binary to hexadecimal

a)
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Step 1. Divide 1314 successively by 2 until the quotient is 0
1314/2 = 657, remainder is 0
657/2 = 328, remainder is 1
328/2 = 164, remainder is 0
164/2 = 82, remainder is 0
82/2 = 41, remainder is 0
41/2 = 20, remainder is 1
20/2 = 10, remainder is 0
10/2 = 5, remainder is 0
5/2 = 2, remainder is 1
2/2 = 1, remainder is 0
1/2 = 0, remainder is 1
Read remainders from the bottom to top as 10100100010

So, 1314 in normal binary is 00000000000000000000010100100010
Step 2: flip all the bits
   00000000000000000000010100100010 is flipped to 11111111111111111111101011011101
Step 3:. Add 1 to above result
11111111111111111111101011011101 + 1 = 11111111111111111111101011011110
so, -1314 in 2's complement binary is 11111111111111111111101011011110
11111111111111111111101011011110 in hexadecimal is 0xFFFFFADE

Answer: 0xFFFFFADE

b)
Since this is a positive number. we can directly convert this into binary
Step 1. Divide 2020 successively by 2 until the quotient is 0
2020/2 = 1010, remainder is 0
1010/2 = 505, remainder is 0
505/2 = 252, remainder is 1
252/2 = 126, remainder is 0
126/2 = 63, remainder is 0
63/2 = 31, remainder is 1
31/2 = 15, remainder is 1
15/2 = 7, remainder is 1
7/2 = 3, remainder is 1
3/2 = 1, remainder is 1
1/2 = 0, remainder is 1
Read remainders from the bottom to top as 11111100100

so, 2020 in 2's complement binary is 00000000000000000000011111100100
00000000000000000000011111100100 in hexadecimal is 0x000007E4

Answer: 0x000007E4

Related Solutions

Assuming integers are represented as 16-bit words and negative numbers are represented using the 2's complementary...
Assuming integers are represented as 16-bit words and negative numbers are represented using the 2's complementary method, convert the following hexadecimal numbers to decimal numbers a. 0xCAFE, b. 0x4DAD, c. 0xFACE
The range of integers that can be represented by this 12-bit construction is -255 to 255...
The range of integers that can be represented by this 12-bit construction is -255 to 255 (a 9-bit signed integer has a range of -256 to 255). What are the floating-point representations for the first eight, odd, positive, decimal integers (i.e., 1, 3, 5, 7, 9, 11, 13, 15) in this 12-bit notation?
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a...
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a 32 bit floating point number. i) A digital camera processes the images images in the real-world and stores them in binary form. Using the principles of digital signal processing, practically explain how this phenomenon occurs.
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit...
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit IEEE floating point numbers to decimal: 0100 1100 1110 0110 1111 1000 0000 0000 1011 0101 1110 0110 1010 0110 0000 0000
Two numbers x and y that are not machine numbers are read into a 32-bit word-length...
Two numbers x and y that are not machine numbers are read into a 32-bit word-length computer. The machine computes to xy2. what sort of relative error can be expected? Assume no underflow or overflow
Design a 32 bit after using a single 4 bit using verilog code
Design a 32 bit after using a single 4 bit using verilog code
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also...
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also show steps to verify that the answer is correct. -7493 and -6372
Design a 32 bit adder using a single 4 bit adder using verilog code
Design a 32 bit adder using a single 4 bit adder using verilog code
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754...
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754 standard is
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers,...
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers, • perform the operation shown, • show all work in binary operating on 4-bit numbers, and • identify overflow if necessary. a) 4 + 2 b) 4 – 2 c) 2 – 4 d) 4 + 4
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT