CS计算机代考程序代写 HW2 Exercise Quiz Results for Zhu, Wenze

HW2 Exercise Quiz Results for Zhu, Wenze
Question 1
0 / 2 pts
Perform the following NEG logical operation, assuming a nine-bit cell: 1 1001 0011
Provide your answer without any spaces or extra characters
Example 100001010 not 1 0000 1010 or NEG = 100001010
001101101
u Answered
001101100
rrect Answers
NEG of 1 1001 0011 is 0 0110 1101
First NOT the nine-bit string 0 0110 1100 Second add 1 0 0110 1101
Question 2
2 / 2 pts
Perform the following OR logical
operations, assuming a nine-bit cell:
0 0000 1111
o
o
Score for this attempt: 34 out of 50 * Submitted Feb 14 at 9:22pm
This attempt took 39 minutes.

1
1
0 0000 1111
OR 1 0111 0101
1 0111 1111
N=1 Z=0
N= 1 (The MSB is 1 so it is negative)
Z= 0 (It is not zero)
OR 1 0111 0101
N= Z=
Provide the N bit for this operation.
Provide a single binary bit with no spaces or words.
Example 1 Not N=1 or One
Correct!
rrect Answers
Question 3
2 / 2 pts
Perform the following AND logical
operation, assuming a nine-bit cell:
0 1001 0011
AND 1 0111 0101
Provide the nine-bit AND
o

rrect Answers
Provide nine bits with no spaces or words.
Example 100001101 Not 1 0000 1101 or AND=100001101
Correct!
000010001
000010001
0 1001 0011
AND 1 0111 0101
0 0001 0001
N= 0 (The MSB is 0 so it is positive)
Z= 0 (It is not zero)
Question 4
2 / 2 pts
Perform the following OR logical operation, assuming
a nine-bit cell:
0 0000 1111
OR 1 0111 0101
N= Z=
Provide the result of the OR operation.
Provide a nine-bit result with no spaces or extra characters
Example 100110101 not 1 0011 0101 or OR=100110101
Correct!
rrect Answers
101111111
101111111
o
o

0 0000 1111
OR 1 0111 0101
1 0111 1111
N=1 Z=0
N= 1 (The MSB is 1 so it is negaitve)
Z= 0 (It is not zero)
Question 5
2 / 2 pts
Perform the following AND logical operation, assuming a nine-bit ce
ll:
0 1001 0011
AND 1 0111 0101
N= Z=
Provide the Z bit for this operation.
Provide a single binary bit with no spaces or words.
Example 1 Not N=1 or One
Correct!
0
0
rrect Answers
o

0 1001 0011
AND 1 0111 0101
0 0001 0001
N= 0 (The MSB is 0 so it is positive)
Z= 0 (It is not zero)
Question 6
2 / 2 pts
Assuming nine-bit two’s complement representation,
convert the following decimal number to binary, and
show the effect of the ASL operation on it.
-62 (decimal)
Provide the nine-bit binary number with no spaces or
extra characters.
Example 110001100 not 1 1000 1100
110000100
110000100
Correct!
rrect Answers
o

ASL(1 1100 0010) 1 1000 0100
Each bit in the cell shifts one place to the
left. The bit that was on the leftmost end
shifts into the carry bit. The rightmost bit
gets 0.
1 1000 0100 (binary) = -124 decimal
NZVC=1001
N =1 (It is negative)
Z= 0 (It is not zero)
V= 0 (The nine-bit number did not chang
signs)
C= 1 (The leftmost bit 1 becomes the carry
bit)
Question 7
2 / 2 pts
Assuming nine-bit two’s complement representation,
convert the following decimal number to binary, and
show the effect of the ASR operation on it.
135 (decimal)
Provide the nine-bit binary number with no spaces or
extra characters.
Example 110001100 not 1 1000 1100
001000011
001000011
Correct!
rrect Answers
o

ASR(0 1000 0111) 0 0100 0011
Each bit in the cell shifts one place to the
right. The least significant bit shifts into
the carry bit. The most significant bit remains
unchanged
0 0100 0011 (binary) = 67 decimal
NZC=001 (No overflow bit because the
msb remains unchanged.)
N =0 (Positive)
Z= 0 (It is not zero)
C= 1 (The lsb bit in the original nine-bit
string is 1)
Question 8
2 / 2 pts
With excess 7 representation, what is the range of
numbers as written in decimal for a 4-bit binary
cell?
-8 to 8 (decimal) -7 to 8 (decimal) -8 to 7 (decimal) 0 to 16 (decimal)
Correct!

Excess 7
Decimal
Excess 4
-7 0000
-6 0001
-5 0010
-4 0011
-3 0100
-2 0101
-1 0110
0 0111
1 1000
2 1001
3 1010
4 1011
5 1100
6 1101
7 1110
8 1111
Question 9
0 / 2 pts
What is the RTL specification for an arithmetic shift right on a six-bit cell.
,;, ,;,
u Answered
,;,
rrect Answer
o o

The RTL specification is:
The msb becomes the carry bit
r(0..4) shifts into r(1..5)
N = 1 if the result is negative
Z= 1 if the result is zero
Question 10
0 / 2 pts
Assuming nine-bit two’s complement representation,
convert the following decimal number to binary, and
show the effect of the ASR operation on it.
-62 (decimal)
Provide the nine-bit binary number with no spaces or
extra characters.
Example 110001100 not 1 1000 1100
111100001
u Answered
-000111110
rrect Answers
o
o

ASR(1 1100 0010) 1 1110 0001
Each bit in the cell shifts one place to the right. The
least significant bit shifts into the carry bit. The most
significant bit remains unchanged
1 1110 0001 (binary) = -31 decimal
NZC=100 (No overflow bit because the msb remains
unchanged.)
N =1 (Negative)
Z= 0 (It is not zero)
C= 0 (The lsb bit in the original nine-bit string is
0)
Question 11
2 / 2 pts
Perform the following additions on unsigned
integers, assuming a seven-bit. Show the effect on
the carry bit.
101 0101
ADD 010 1010
C=
For the answer show ONLY the carry bit as a 0 or a
1.
Do not show the addition or any additional words or
spaces
Example 1 NOT C=1
0
Correct!
rrect Answers
0
o

101 0101
ADD 010 1010
111 1111
C=0
Question 12
0 / 2 pts
Convert 1 0000 0001 from binary to decimal, assuming nine-bit two’s complement binary representation.
Provide on the number. For a negative number provide the negative sign.
Example 79 NOT +79 or 78 Decimal Example -79 NOT negative 79 or -79 Decimal
-255
u Answered
257
rrect Answers
1 0000 0001
Add the place value everywhere there is a zero. Add one to the result
Add the negative sign
128 + 126 = 254 255 +1 = 255
– 255
o
o

Question 13
0 / 2 pts
Convert 1 1111 1100 from binary to decimal, assuming nine-bit two’s complement binary representation.
Provide on the number. For a negative number provide the negative sign.
Example 79 NOT +79 or 78 Decimal Example -79 NOT negative 79 or -79 Decimal
-4
u Answered
508
rrect Answers
1 1111 1100
Add the place value everywhere there is a zero. Add one to the result
Add the negative sign
2 +1 =3 3 +1 =4 -4
Question 14
2 / 2 pts
Convert 11110000 from binary to decimal, assuming unsigned binary representation.
Provide the decimal number only with no extra words or spaces.
o
o

Correct!
rrect Answers
240
240
128 + 64 + 32 + 16 = 240
Question 15
0 / 2 pts
Convert 1 0000 0000 from binary to decimal, assuming nine-bit two’s complement binary representation.
Provide on the number. For a negative number provide the negative sign.
Example 79 NOT +79 or 78 Decimal Example -79 NOT negative 79 or -79 Decimal
-256
u Answered
256
rrect Answers
1 0000 0000
Add the place value everywhere there is a zero. Add one to the result
Add the negative sign
128 + 127 = 255 255 +1 = 256
– 256
o
o
o

Question 16
2 / 2 pts
Suppose you have a 12-bit cell. Find a binary
number such that when you add it to the
following, the sum is all 0’s. That is, find the
missing number in the following operation:
0110 0101 0111
ADD ???? ???? ????
The number you find may set the carry bit to 1.
0110 0101 0111
ADD 1001 1010 1001
0110 0101 0111
ADD 1001 1010 1000
0110 0101 0111
ADD 1111 1010 1001
0110 0101 0111
ADD 0001 1010 1001
Correct!
0110 0101 0111
ADD 1001 1010 1000
C=1
Question 17
2 / 2 pts

Perform the following additions on unsigned
integers, assuming a seven-bit. Show the effect on
the carry bit.
101 1001
ADD 011 0111
C=
For the answer show ONLY the carry bit as a 0 or a
1.
Do not show the addition or any additional words or
spaces
Example 1 NOT C=1
1
1
Correct!
rrect Answers
101 1001
ADD 011 0111
001 0000
C=1
Question 18
2 / 2 pts
Perform the following addition on unsigned integers,
assuming a nine-bit cell. Show the effect on the
carry bit.
o

rrect Answers
1 1111 1111
ADD 0 0000 0001
C=
Provide only a 0 or a 1 for the carry bit. Do not
add any words or spaces.
Example 0 NOT C=0
1
1
Correct!
1 1111 1111
ADD 0 0000 0001
0 0000 0000
C=1
Question 19
2 / 2 pts
Convert 1010101 from binary to decimal, assuming unsigned binary representation.
Provide the decimal number only with no extra words or spaces.
85
85
Correct!
rrect Answers
o
o

64 + 16 + 4 + 1 = 85
Question 20
2 / 2 pts
Convert 25 from decimal to binary, assuming unsigned binary representation.
Provide only the binary number with no additional words or spaces.
11001
11001
Correct!
rrect Answers
25
12 1
60 30 11 01 11001
Question 21
2 / 2 pts
Convert 10101 from binary to decimal, assuming unsigned binary representation.
Provide the decimal number only with no extra words or spaces.
o

Correct!
21
21
rrect Answers
16 + 4 + 1 = 21
Question 22
2 / 2 pts
Convert 160 from decimal to binary, assuming unsigned binary representation.
Provide only the binary number with no additional words or spaces.
10100000
10100000
Correct!
rrect Answers
160
80 0
40 0
20 0
10 0
50 21 10 01
10100000
o
o

Question 23
2 / 2 pts
Count the next 5 numbers in binary starting after 11011. (Don’t include 11011)
Provide you answer with only numbers and a space between each number. No extra spaces or words
Example 10101 10110 10111 NOT 10101, 10110, 10111 or 1 0101, 1 0110, 1 0111
11100 11101 11110 11111 100000
11100 11101 11110 11111 100000
Correct!
rrect Answers
11100 11101 11110 11111 100000
Question 24
0 / 2 pts
Count the next 10 numbers in octal starting after 466. (Don’t include 466)
Provide you answer with only numbers and spaces. No extra spaces or words
Example 460 461 462 NOT 460, 461, 462
467 470 471 472 473 474 475 476 477 500
u Answered
467 470 471 472 473 474 475 476 477 480
rrect Answers
o
o
o

Question 25
Not yet graded / 2 pts
Below in an example of a binary problem with a
missing number. Don’t solve this problem, but
describe a rule for finding the missing number in
general.
0110 0101 0111
ADD ???? ???? ????
0000 0000 0000
Your Answer:
Rule of finding 2’s complement:
Complement each bit of the number to find the 1’s complement.
Add 1 to the complement to find the 2’s complement. Here, ignore the carry generated by most significant bit.
Rules of binary Addition:
Find the 2’s complement of the number N, say “N”. Add N and N” using rules of binary addition. Ignore the carry generated by MSB
Quiz Score: 34 out of 50
467 470 471 472 473 474 475 476 477 500