1 / 14

Computer Architecture

Computer Architecture. Lecture 14 Fasih ur Rehman. Last Class. Control Unit Microprogrammed Control. Today’s Agenda. Arithmetic (Integer) Representation Signed numbers Operations and their implementation. Binary Representation. Binary Representation. Signed Numbers.

frey
Download Presentation

Computer Architecture

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. Computer Architecture Lecture 14 FasihurRehman

  2. Last Class • Control Unit • Microprogrammed Control

  3. Today’s Agenda • Arithmetic (Integer) • Representation • Signed numbers • Operations and their implementation

  4. Binary Representation

  5. Binary Representation

  6. Signed Numbers • Representation Methods • Signed Magnitude • 1’s Complement • 2’s Complement

  7. Signed Magnitude

  8. 1’s Complement • – N = (2n -1) - N • where: n is the number of bits per word • N is a positive integer • -N in 1's complement (Negative Number) • For example with an 8-bit word and N = 6, we have: • – N = (28 -1) - 6 = 255 - 6 = 249 = 11111001 • Alternatively • N = +6 = 000001102 • (-N ) = -6 = 111110012 • the values 00000000 and 11111111 both represent zero

  9. 2’s Complement • N * = 2n- N • where: n is the number of bits per word • N is a positive integer • N* is -N in 2's complement notation • For example with an 8-bit word and N = 6, we have: N* = 28 - 6 = 256 - 6 = 250 = 11111010 • Alternatively, to take 2's complement is to start at the right and complement each bit to the left of the first "1". • For example: N = +6 = 00000110 • N* = -6 = 11111010

  10. Examples

  11. Examples

  12. Examples

  13. Addition/subtraction of signed numbers x y Carry-in c Sum s Carry-out c i i i i i +1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 x y c + x y c + x y c + x y c s = = x Å y Å c i i i i i i i i i i i i i i i i y c x c x y c = + + i i i i i i i +1 E xample: x X 7 0 1 1 1 Carry-out Carry-in i y + Y = + 6 = + 0 1 1 0 0 1 1 0 0 c i c i +1 i 13 1 1 0 1 s Z i Legend for stage i

  14. Summary • Arithmetic • Representation • Signed numbers • Operations and their implementation

More Related