Question 1 Report
The computer used to calibrate an electric ferry records a change in motor torque as an 8-bit two's complement binary number. During a harbour test, the engineer sees the diagnostic display in Fig. 1. A negative number means that the control algorithm must reduce torque. The computer has allocated one byte of memory for each reading.
Fig. 1
(a) State whether the number in Fig. 1 is positive or negative. [1]
(b) Give the decimal value represented by the binary number in Fig. 1. Show your working. [3]
(c) State the greatest positive decimal number that can be stored in this 8-bit two's complement format. [1]
(d) Give one reason why two's complement is used instead of storing a separate sign symbol and an unsigned binary magnitude. [1]
(a) The most significant bit is 1. In two's complement, this indicates a negative number. [1]
(b) To find the magnitude of a negative two's complement number, invert every bit and add 1:
Stored value: 10011010 Invert bits: 01100101 Add 1: 01100110
\(01100110_2=64+32+4+2=102\). Since the original value was negative, the decimal value is −102. [3]
(c) For an 8-bit two's complement number, the greatest positive value is \(2^7-1=127\). One bit is used to distinguish positive from negative values. [1]
(d) Two's complement allows addition and subtraction to use the same binary arithmetic circuitry for positive and negative values. This is an advantage over separate sign-and-magnitude storage. [1]
Examination reminder: Do not treat a negative two's complement number as ordinary unsigned binary. Invert and add 1, then apply the negative sign.
Everything you need to excel in your exams