CS计算机代考程序代写 assembly Comp 3350: Computer Organization & Assembly Language

Comp 3350: Computer Organization & Assembly Language
HW # 1: Theme: Binary Number Representations (Review of prerequisites) All main questions are of equal weight.
(Credit awarded to only those answers that show work)
1. What is the decimal representation of each of the binary integers below: assume (a) and (b) are signed and (c) is unsigned?
a. 1111 1011
b. 0110 0100
c. 1001 1010
Ans:
a. 1111 1011 is signed, the highest bit is a 1
1. reverse the bits
2. add 1
3. convert the absolute value to decimal 4. the original binary integer is negative
¬1111 1011 = 0000 0100
0000 0100 + 1 = 0000 0101 0000 0101 = 5
the decimal representation = -5
b. 0110 0100 is signed, the highest bit is a 0, convert it as if it is an unsigned binary integer 1. convert the absolute value to decimal 0110 0100 = 100
2. the original binary integer is positive the decimal representation = 100
c. 1001 1010 is unsigned
1. convert the absolute value to decimal
1001 1010 = (1×27) + (0×26) + (0×25) + (1×24) + (1×23) + (0×22) + (1×21) + (0×20) = (154)10 2. the decimal representation = 154
2. What is the minimum number of binary bits needed to represent each of the following decimal numbers?
a. 65437
b. 10361
c. -4177
Ans:
a. 65437= 1111 1111 1001 1101
the minimum number of binary bits is 16
b. 10361= 10 1000 0111 1001
the minimum number of binary bits is 14
c. -4177= 1 0000 0101 0001
the minimum number of binary bits is 13
3. What is the hexadecimal representation of each of the following binary numbers?
a. 1011 1001 1001 1100
b. 1101 0110 0111 0011
c. 0011 0110 0001 1001
Ans:
a. 1011 1001 1001 1100 = 0xB99C
b. 1101 0110 0111 0011 = 0xD673
c. 0011 0110 0001 1001 = 0x3619

4. What is the decimal value of the following representation of each hex integer below—assume they use unsigned notation?
a. 4024
b. FEE
c. 10F3
Ans:
a. 4024 = (1000 0000 0100 100)2 = (16420)10
b. FEE = (1111 1110 1110)2 = (4078)10
c. 10F3 = (0001 0000 1111 0011)2 = (4339)10
5. What is the 16-bit hexadecimal representation of each decimal integer?
a. –619
b. –312
c. +1947
Ans:
a. -619
1. convert the absolute value to binary
2. reverse the bits ¬ 0000 0010 0110 1011= 1111 1101 1001 0100 3. add 1 1111 1101 1001 0100 + 1 = 1111 1101 1001 0101 4. the 16-bit hexadecimal representation = FD95
b. -312
1. convert the absolute value to binary 312 = 0000 0001 0011 1000
2. reverse the bits ¬ 0000 0001 0011 1000 = 1111 1110 1100 0111 3. add 1 1111 1110 1100 0111+ 1 = 1111 1110 1100 1000 4. the 16-bit hexadecimal representation = FEC8
c. +1947
1. convert the absolute value to binary 1947 = 0000 0111 1001 1011 2. the 16-bit hexadecimal representation = 079B
6. What is the 8-bit binary (2’s complement) representation of each of the decimal integers?
a. –35
b. +103
c. –114
Ans:
a. -35 is negative
1. convert the absolute value to binary
2. reverse the bits
3. add 1
4. the 8-bit binary representation = 1101 1101
b. +103 is positive
1.convert the absolute value to binary 103 = 0110 0111 2. the 8-bit binary representation = 0110 0111
619 = 0000 0010 0110 1011
35 = 0010 0011
¬0010 0011 = 1101 1100 1101 1100 + 1 = 1101 1101

c. -114 is negative
1. convert the absolute value to binary
2. reverse the bits
3. add 1
4. the 8-bit binary representation = 1000 1110
7. Write the ASCII code for the string “COVID”. The answer should provide ASCII (in hexadecimal) corresponding to each letter in the string. The ASCII values can be found on the inner cover of the book.
Ans:
COVID = 0x434F564944
8. What is the range of decimal values that can be represented by: a) 7-bit unsigned integer?
b) 7-bit signed integer?
Ans:
a. mini=0
max = 27 – 1= (1111111)2 = (127)10
b. mini = -26 = (1000000)2 = (-64)10 max = 26 – 1 = (0111111)2 = (63)10
114 = 0111 0010
¬0111 0010= 1000 1101 1000 1101+ 1 = 1000 1110