An 8-bit register can be read as an unsigned integer or as a two's complement integer. For each bit pattern in the table, enter both decimal values. Type a negative sign as a hyphen, for example -9.
Unlock full course notes by signing up
Adding two positive bytes
An 8-bit processor adds the two's complement values 0100 1101 and 0011 1110 and keeps only the low eight bits of the sum. Give the 8-bit result pattern as eight binary digits, the decimal value that this pattern represents in two's complement, the carry out of the most significant bit (0 or 1), and whether the signed addition overflowed (yes or no).
Three signed encodings of the same values
Three common ways to store a negative integer in 8 bits are sign-magnitude, ones' complement and two's complement. Complete the table by writing each value in all three representations. Type every pattern as exactly eight bits with no spaces.
Widening a signed sensor reading
A temperature sensor sends an 8-bit two's complement reading of 11110011211110011_2111100112. The controller stores readings in 16-bit signed registers, so the byte must be widened before it is used. Give the decimal value of the 8-bit reading as a whole number. Then give the 16-bit pattern after sign extension, written as four hexadecimal digits. Finally, give the decimal value the 16-bit register would hold if the byte were wrongly zero-extended (padded with 0 bits), as a whole number.
Claims about 8-bit overflow
Consider 8-bit two's complement arithmetic in which every sum is truncated to eight bits and subtraction is performed by adding the negated operand. Which of the following statements are true? Select all that apply.