Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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?
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?
0 -> j // Store 0 in j
-3 -> k // Store -3 in k
while k 0
j = j + 1
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:
j | (binary) | k | (binary) |
0 | 0000 | -3 | 1100 |
1 | 0001 | -4 | 1011 |
Complete the table using whatever editor you prefer (hand drawn neatly is OK)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started