Suppose a computer uses 4-bit one\'s complement representation. Ignoring overflo
ID: 3858859 • Letter: S
Question
Suppose a computer uses 4-bit one's complement representation. Ignoring overflows, what value will be stored in the variable j after the following pseudocode routine terminates?
k = k - 1
Create a table showing the trace for j and k in decimal and binary. Remember that in one's complement addition, the last carry is added to the sum). Here are the first two lines of the table:
Complete the table using whatever editor you prefer (hand drawn neatly is OK)
j (binary) k (binary) 0 0000 -3 1100 1 0001 -4 1011Explanation / Answer
J (binary) k (binary) 0 0000 -3 1100 1 0001 -4 1011 2 0010 -5 1010 3 0011 -6 1001 4 0100 -7 1000 5 0101 -8 0111 6 0110 -9 0110 7 0111 -10 0101 8 1000 -11 0100 9 1001 -12 0011 10 1010 -13 0010 11 1011 -14 0001 12 1100 -15 0000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.