You are subtracting the 4-bit unsigned numbers 10002−001121000_2 - 0011_210002−00112 (that is, 8 − 3). The rightmost column reads 0 − 1, and the only 1 in the top number is in the 8s column. Arrange the events of the borrow and the column subtractions in the order they happen.
1.
The 2s column keeps one two, so its top bit becomes 1, and lends the other two to the 1s column as two ones.
2.
Subtract in the 1s column: two minus one leaves 1.
3.
The 4s column keeps one four, so its top bit becomes 1, and lends the other four to the 2s column as two twos.
4.
Look left past the 0s in the 2s and 4s columns until you reach the 1 in the 8s column.
5.
Subtract the 2s, 4s and 8s columns using their updated top bits to get 010120101_201012.
6.
In the 1s column, recognise that 0 − 1 cannot be done without a borrow.
7.
The 8s column's top bit becomes 0, and the lent eight arrives in the 4s column as two fours.
Unlock full course notes by signing up
8-bit subtraction with chained borrows
An 8-bit unsigned register holds 10100001210100001_2101000012. A program subtracts 00110110200110110_2001101102 from it. Compute the difference by hand using borrows, and give it as an 8-bit binary number including any leading zeros.
Shift-and-add multiplication
Multiply the unsigned binary numbers 101121011_210112 (the multiplicand) and 1102110_21102 (the multiplier) using shift-and-add partial products. Give the product in binary with no leading zeros, and also give the product as a decimal integer.
Overflow in a 4-bit unsigned register
A processor adds the unsigned values 110121101_211012 and 011020110_201102 in a 4-bit register, which keeps only the lowest four bits of any result. Which of the following statements about this addition are true? Select all that apply.
Multiplying by 5 and 10 with shifts and one addition
An 8-bit unsigned register holds x=000101102x = 00010110_2x=000101102. A processor without a multiply instruction computes 5x5x5x as 4x+x4x + x4x+x, using a left shift by two places for 4x4x4x, and then computes 10x10x10x by shifting 5x5x5x left by one place. Find xxx shifted left by two places, 5x5x5x and 10x10x10x, each as an 8-bit binary pattern including leading zeros, and give the decimal value of 10x10x10x as a whole number.