SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Chapter 1
DATA REPRESENTATION
Complements

Examples                  Examples
   10’s C                    1’s C
    • 512790 = 487210          • 011100 = 100011
    • 14672.3 = 85327.7
                              2’s C
   7’s C                      • 010101 = 101011
    • 65172 = 12605
                              16’s C
                               • 59A1D = A65E3
Systems Used to Represent Negative Numbers

Signed-Magnitude Representation
    A number consists of a magnitude and a symbol
     indicating whether the magnitude is positive or
     negative.

Examples:
     +85 = 010101012           -85 = 110101012
     +127 = 011111112          -127 = 111111112
Systems Used to Represent Negative Numbers


Signed-Complement System
• This system negates a number by taking its
  complement as defined by the system.

Examples:
  +85 = 010101012           -85 = 101010102 (1s)
  +127 = 011111112          -127 = 100000012 (2s)
Chapter 2

COMPUTER ARITHMETIC
Arithmetic in various Number Systems

• Addition of numbers in any number system
  – Add numbers starting at the least significant
    digit.
  – Perform addition on numbers of the same
    number base.
• Subtraction of numbers
  – Must use complements
Binary Addition

• To add binary numbers: (X + Y)
   – Get the SCR of the negative numbers
   – Add the two numbers
   – If the SCR used is:
      • 2's C: Discard end carry
      • 1's C: Add the end carry to the sum
Example: Binary Addition

• Add the following numbers. Use 8 bits to
  represent each number.
  – 6 + 13
  – 6 + (-13)
  – (-6) + 13
  – (-6) + (-13)
Example: Binary Addition


•   6 + 13 = 19
Example: Binary Addition


•   6 + 13 = 19
    0 0000110
Example: Binary Addition


•   6 + 13 = 19
    0 0000110
+   0 0001101
Example: Binary Addition


•   6 + 13 = 19
    0 0000110
+   0 0001101
=   0 0010011
Example: Binary Addition


•   6 + 13 = 19   •   6 + (-13) = -7
    0 0000110           0 0000110
+   0 0001101
=   0 0010011
Example: Binary Addition


•   6 + 13 = 19   •   6 + (-13) = -7
    0 0000110           0 0000110
+   0 0001101                          (1's)
=   0 0010011
Example: Binary Addition


•   6 + 13 = 19   •       6 + (-13) = -7
    0 0000110               0 0000110
+   0 0001101         +     1 1110010 (1's)
=   0 0010011
Example: Binary Addition


•   6 + 13 = 19   •       6 + (-13) = -7
    0 0000110               0 0000110
+   0 0001101         +     1 1110010 (1's)
=   0 0010011         =     1 1111000
Example: Binary Addition


 • (-6) + 13 = 7
                (2's)




6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7
    1 1111010 (2's)




6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7
   1 1111010 (2's)
 + 0 0001101



6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7
   1 1111010 (2's)
 + 0 0001101
 =10 0000111


6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7
   1 1111010 (2's)
 + 0 0001101
 =10 0000111


6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7     •   (-6) + (-13) = -19
   1 1111010 (2's)         1 1111010 (2's)
 + 0 0001101
 =10 0000111


6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7     •       (-6) + (-13) = -19
   1 1111010 (2's)             1 1111010 (2's)
 + 0 0001101             +     1 1110011 (2's)
 =10 0000111


6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7     •     (-6) + (-13) = -19
   1 1111010 (2's)          1 1111010 (2's)
 + 0 0001101             + 1 1110011 (2's)
 =10 0000111             = 11 1101101


6 = 0 0000110
Example: Binary Addition


 • (-6) + 13 = 7     •     (-6) + (-13) = -19
   1 1111010 (2's)          1 1111010 (2's)
 + 0 0001101             + 1 1110011 (2's)
 =10 0000111             = 11 1101101


6 = 0 0000110
Examples: Addition

• (999.5 + 281.6)10
        1 1 1

        999.5
  +     281.6
       1 281.1
Examples: Addition

• (999.5 + 281.6)10   • (110.11 + 101010.11)2
        1 1 1                 1 1 1   1   1

        999.5                  110.11
  +     281.6          +    101010.11
       1 281.1              1100 01.10
Examples: Addition

• (355.45 + 240.664)8

   355.45
 + 240.664
 =
Examples: Addition

• (355.45 + 240.664)8
         1

   355.45
 + 240.664
 =           4
Examples: Addition

• (355.45 + 240.664)8
         1

   355.45
 + 240.664
 =        34
Examples: Addition

• (355.45 + 240.664)8
        1   1

   355.45
 + 240.664
 =     6.3 34
Examples: Addition

• (355.45 + 240.664)8
     1   1   1

   355.45
 + 240.664
 = 6 16.3 3 4
Examples: Addition

• (355.45 + 240.664)8   • (A0C.D + E72.9)16
      1   1   1

   355.45                      A0C.D
 + 240.664               +     E72.9
 = 6 16.3 3 4            =
Examples: Addition

• (355.45 + 240.664)8   • (A0C.D + E72.9)16
      1   1   1                   1

   355.45                      A0C.D
 + 240.664               +     E72.9
 = 6 16.3 3 4            =         .6
Examples: Addition

• (355.45 + 240.664)8   • (A0C.D + E72.9)16
      1   1   1                    1

   355.45                      A0C.D
 + 240.664               +     E72.9
 = 6 16.3 3 4            =   1 8 7 F.6

Weitere ähnliche Inhalte

Was ist angesagt?

Conversiones binario decimal/ decimal binario
Conversiones binario decimal/ decimal  binarioConversiones binario decimal/ decimal  binario
Conversiones binario decimal/ decimal binario
aidalyb2
 
comp.org Chapter 2
comp.org Chapter 2comp.org Chapter 2
comp.org Chapter 2
Rajat Sharma
 
Reducing fractions
Reducing fractionsReducing fractions
Reducing fractions
almasmarin
 
Taller de conversiones binariodecimal
Taller de conversiones binariodecimalTaller de conversiones binariodecimal
Taller de conversiones binariodecimal
Jaramillopaola
 
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
Jirathorn Buenglee
 
Naskah Murid Modul 1 Number Bases
Naskah Murid Modul 1 Number BasesNaskah Murid Modul 1 Number Bases
Naskah Murid Modul 1 Number Bases
ZURAIDA ADAM
 
Taller de conversiones binariodecimal
Taller de conversiones binariodecimalTaller de conversiones binariodecimal
Taller de conversiones binariodecimal
Juan D Patiño Torres
 

Was ist angesagt? (19)

1.0 number bases form 5
1.0 number bases form 51.0 number bases form 5
1.0 number bases form 5
 
ALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMSALL ABOUT NUMBER SYSTEMS
ALL ABOUT NUMBER SYSTEMS
 
Konversi bilangan octal
Konversi bilangan octalKonversi bilangan octal
Konversi bilangan octal
 
Math unit7 number system and bases
Math unit7 number system and basesMath unit7 number system and bases
Math unit7 number system and bases
 
Topic 3 decimals
Topic 3   decimalsTopic 3   decimals
Topic 3 decimals
 
Taller De Conversiones B/D D/B
Taller De Conversiones B/D D/BTaller De Conversiones B/D D/B
Taller De Conversiones B/D D/B
 
Forecasting Attendance at SWU Football Games
Forecasting Attendance at SWU Football GamesForecasting Attendance at SWU Football Games
Forecasting Attendance at SWU Football Games
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
Conversiones binario decimal/ decimal binario
Conversiones binario decimal/ decimal  binarioConversiones binario decimal/ decimal  binario
Conversiones binario decimal/ decimal binario
 
200203 answers01
200203 answers01200203 answers01
200203 answers01
 
comp.org Chapter 2
comp.org Chapter 2comp.org Chapter 2
comp.org Chapter 2
 
Reducing fractions
Reducing fractionsReducing fractions
Reducing fractions
 
Octal and Hexadecimal Numbering Systems
Octal and Hexadecimal Numbering SystemsOctal and Hexadecimal Numbering Systems
Octal and Hexadecimal Numbering Systems
 
Taller de conversiones binariodecimal
Taller de conversiones binariodecimalTaller de conversiones binariodecimal
Taller de conversiones binariodecimal
 
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
แบบทดสอบ ชุดที่ 2 สมการเชิงเส้นตัวแปรเดียว
 
Naskah Murid Modul 1 Number Bases
Naskah Murid Modul 1 Number BasesNaskah Murid Modul 1 Number Bases
Naskah Murid Modul 1 Number Bases
 
Number system
Number systemNumber system
Number system
 
01.Number Systems
01.Number Systems01.Number Systems
01.Number Systems
 
Taller de conversiones binariodecimal
Taller de conversiones binariodecimalTaller de conversiones binariodecimal
Taller de conversiones binariodecimal
 

Andere mochten auch (11)

Cmsc 100 (web content)
Cmsc 100  (web content)Cmsc 100  (web content)
Cmsc 100 (web content)
 
Chapter2c
Chapter2cChapter2c
Chapter2c
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
Chapter2b
Chapter2bChapter2b
Chapter2b
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter1b
Chapter1bChapter1b
Chapter1b
 
linked list (CMSC 123)
linked list (CMSC 123)linked list (CMSC 123)
linked list (CMSC 123)
 
Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)
 
Chapter1c
Chapter1cChapter1c
Chapter1c
 
Chapter2d
Chapter2dChapter2d
Chapter2d
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 

Ähnlich wie Chapter2a

2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
Wan Afirah
 
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Hsien-Hsin Sean Lee, Ph.D.
 
Number system
Number systemNumber system
Number system
aviban
 

Ähnlich wie Chapter2a (20)

2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
 
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
 
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
Solution_Manual_Digital_Design_With_an_Introduction_to_the_Verilog_HDL_5th_Ed...
 
Ch_10.pptx.pdf
Ch_10.pptx.pdfCh_10.pptx.pdf
Ch_10.pptx.pdf
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Digital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdfDigital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdf
 
Cse115 lecture01numbersystems
Cse115 lecture01numbersystemsCse115 lecture01numbersystems
Cse115 lecture01numbersystems
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptx
 
Number system
Number systemNumber system
Number system
 
DIGITAL ELECTRONICS.pptx
DIGITAL ELECTRONICS.pptxDIGITAL ELECTRONICS.pptx
DIGITAL ELECTRONICS.pptx
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
 
CMSC 56 | Lecture 10: Integer Representations & Algorithms
CMSC 56 | Lecture 10: Integer Representations & AlgorithmsCMSC 56 | Lecture 10: Integer Representations & Algorithms
CMSC 56 | Lecture 10: Integer Representations & Algorithms
 
Dld 3
Dld 3Dld 3
Dld 3
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 

Kürzlich hochgeladen

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 

Kürzlich hochgeladen (20)

8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 

Chapter2a