1 / 7

Binary Subtraction

Binary Subtraction. borrow. -). Subtracter. A. R. Subtracter. B. b. Arithmetic: Subtraction. 293 – 154 = 139. 293 – 154 = 293 + ( -154). 293 – 154 = 293 + ( 1,000,000 - 154) - 1,000,000. ( 1,000,000 - 154) = 999,846. 099,999 +) 900,000 999,999. +). Positive:

Download Presentation

Binary Subtraction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Binary Subtraction borrow -)

  2. Subtracter A R Subtracter B b

  3. Arithmetic: Subtraction 293 – 154 = 139 293 – 154 = 293 + ( -154) 293 – 154 = 293 + (1,000,000 - 154) - 1,000,000 (1,000,000 - 154) = 999,846 099,999 +) 900,000 999,999 +) Positive: 000,000 ~ 099,999 Negative: 900,000 ~ 999,999 ( -100,000 ~ -1 ) 0: positive 1—8 : not used 9: negative Sign digit

  4. Positive: 000,000 ~ 099,999 Negative: 900,000 ~ 999,999 ( -100,000 ~ -1 ) 10’s Complement X = - 025,980 9’s Complement of X (9+1)’s Complement of X 900,000 – 1 = 899,999 899,999  100,000  -100,000 999,999 – 1 = 999,998 999,998  000,001  -1

  5. Binary Subtraction 0110,0011 – 0001,1100 = 0100,0111 0110,0011 – 0001,1100 = 0110,0011 + ( - 0001,1100) = 0110,0011 + (1,0000,0000 – 0001,1100) – 1,0000,0000 (1,0000,0000 – 0001,1100) = 1110,0100 Positive: 0000,0000 ~ 0111,1111 (0 ~ 127) Negative: 1000,0000 ~ 1111,1111 ( -1000,0000 ~ -0000,0001 ) (-128 ~ -1) Sign bit 0: positive 1: negative

  6. Positive: 0000,0000 ~ 0111,1111 (0 ~ 127) Negative: 1000,0000 ~ 1111,1111 ( -1000,0000 ~ -0000,0001 ) (-128 ~ -1) 2’s Complement X = - 0110,1101  1’s Complement of X (1+1)’s Complement of X 1000,0000 – 1 = 0111,1111 0111,1111  1000,0000  -1000,0000 1111,1111 – 1 = 1111,1110 1111,1110  0000,0001  -1

  7. Complement numbers and Subtraction Let a and b be two unsigned numbers. • Decimal numbers (base 10) • If a is 10’s complement of b, then b is 10’s complement of a. • a - b = a + (the 10’s complement of b) • Binary numbers (base 2) • If a is 2’s complement of b, then b is 2’s complement of a. • a - b = a + (the 2’s complement of b) The 2’s complement of a binary unsigned can be found efficiently.

More Related