Perform the following decimal subtraction problems using binary numbers in a 4-bit word. Use 2's complement notation to convert the subtraction problem into an equivalent addition problem. Then carry out the binary addition. Show your work and your carry bits as in the previous examples. Indicate when an overflow occurs.

From +2 subtract + 2
The subtraction problem is: +2 — (+2)
The equivalent addition problem is: +2 + (-2)


First find the 2's complement of +2. This will be the representation of— 2.
Start with +2: 0010
Flip the bits: 1101
Add one to get —2: 1110
Add 0010 (+ 2) and 1110 (-2) to get 0000 (0)
Carry bit: 1 1 1 0
First number: 1 1 1 0 (— 2)
Second number: 0 0 1 0 (+ 2)
Result: * 0 0 0 0 (+ 0) * The final carry is discarded

Computer Science & Information Technology

You might also like to view...

Write a program that allows students to schedule appointments at either 1, 2, 3, 4, 5, or 6 o’clock p. m. Use an array of six strings to store the names for the time slots. Write a loop that iterates as long as the array has a free space. Within a try block, allow the user to enter a time and a name. If the time is free, put the name in the array. If the time is not free, throw a TimeInUseException. If the time is not valid, throw an InvalidTimeException. Use a catch block for each different kind of exception.

What will be an ideal response?

Computer Science & Information Technology

The system unit case for a desktop computer contains several storage device "parking spaces" called ____ bays.

A. access B. solid-state C. expansion D. USB

Computer Science & Information Technology

Subscripts begin with a value of ____.

A. -1 B. 0 C. 1 D. the number of elements in the array

Computer Science & Information Technology

Containers are essentially used ____.

A. to manipulate data B. to step through a set of given elements C. to manage objects of a given type D. to update objects that are part of a given set of elements

Computer Science & Information Technology