ECE 3110: Introduction to Digital SystemsPrevious class SummaryBinary Addition, Subtraction (single digit)Slide 4Binary, Decimal additionSubtractionOctal/Hex addition/subtractionNext…ECE 3110: Introduction to Digital SystemsNumber Systems: unsigned numbers addition/subtraction2Previous class SummaryConversions:Binary, Oct, HexAny number <---->Decimal3Binary Addition, Subtraction (single digit)The rules for binary addition are: 0 + 0 = 0, carry = 01 + 0 = 1, carry = 00 + 1 = 1, carry = 01 + 1 = 0, carry = 1The rules for binary subtraction are: 0 - 0 = 0, borrow = 01 - 0 = 1, borrow = 00 - 1 = 1, borrow = 11 - 1 = 0, borrow = 0Multiple digits:Borrows, Carries from digits to left of current of digit.Binary subtraction, addition works just the same as decimal addition, subtraction.4cin or binX Y Couts Boutd0 0 0 0 0 0 00 0 1 0 1 1 10 1 0 0 1 0 10 1 1 1 0 0 01 0 0 0 1 1 11 0 1 1 0 1 01 1 0 1 0 0 01 1 1 1 1 1 1Binary Addition, Subtraction (multiple digits)5Binary, Decimal addition 34+ 17------ 51from LSD to MSD:7+4 = 1; with carry out of 1 to next column1 (carry) + 3 + 1 = 5.answer = 51.Decimal 1010112+ 0000012--------------- 1011002From LSB to MSB:1+1 = 0, carry of 11 (carry)+1+0 = 0, carry of 11 (carry)+0 + 0 = 1, no carry1 + 0 = 10 + 0 = 01 + 0 = 1 answer = 1011002Binary6SubtractionDecimal 900- 001------- 8990-1 = 9; with borrow of 1 from next column0 -1 (borrow) - 0 = 9, with borrow of 1 9 - 1 (borrow) - 0 = 8.Answer = 899.Binary 1002- 0012 ------- 01120-1 = 1; with borrow of 1 from next column0 -1 (borrow) - 0 = 1, with borrow of 1 1 - 1 (borrow) - 0 = 0.Answer = 0112.7Octal/Hex addition/subtractionRarelyConvert to decimal-->calculate results-->convert back.Column addition/subtraction (example pp34)8Next…Signed
View Full Document