SlideShare a Scribd company logo
1 of 6
An integer is a whole number, positive or negative. Every integer stored in the computer is allocated the same amount of space, whether it is a large integer or a small integer.  The number of bits allocated determines the range of numbers which can be stored. If one byte was allowed then the largest integer would be: 11111111 which is 255 in decimal or 28 - 1 Two bytes would allow: 216 -1 possibilities = a range from 0 to 65535. Integers
If a computer only had to store positive integers then we could easily convert each number into its binary equivalent as you saw in the examples earlier.  However, negative numbers have to be stored too and we need to find a method of representing a –ve sign using 1s and 0s. Modern computers use the Two’s complement method to represent integers. Negative Integers
With this method we take the  most significant bit  (the one on the far left) and treat it as a  negative number . The following examples illustrate the principle using 4 bit numbers to help you understand.  A modern computer would use 32 bit numbers for integers. In your NABS and final exams you are likely to be asked to use 8 bit number. Two's Complement
Binary Decimal 1000 -8 1001 -7 1010 -6 1011 -5 1100 -4 1101 -3 1110 -2 1111 -1 0000 0 0001 +1 0010 +2 0011 +3 0100 +4 0101 +5 0110 +6 0111 +7 In this table the 1 at the far left represents -8 (negative 8). Make sure that you understand this concept Note that the range is still 2 4  = 16 numbers  = -8 to +7 Two’s Complement
Range and Accuracy of Two’s Complement 1.  The  range  of numbers which can be stored depends on the number of bits being used. 4 bit numbers have a range 8 bit numbers have a range -8 to +7 -128 to +127 3.  Numbers stored using two’s complement are always 100%  accurate . 2.   In a modern computer 32 bits are used stored integers.   This gives a  range  of 2 32  around -2,147,483,648 to +2,147,483,647
8 Bit Two’s complement numbers Here is an example of how to work out the Two’s complement for the number -80 -80 =  -128 64 32 16 8 4 2 1 1 0 0 1 1 0 0 0 1. The number is negative so put a 1 in the first column. 128 80 48 2. Subtract the 80 from 128. 3. Now make 48 from the remaining columns using normal binary rules.  32 16 16 0

More Related Content

What's hot

Analog and digital signals
Analog and digital signalsAnalog and digital signals
Analog and digital signalsteja reddy
 
Real life application of Function.
Real life application of Function.Real life application of Function.
Real life application of Function.Jholok Biswash
 
Logic gates ppt
Logic gates pptLogic gates ppt
Logic gates pptparassini
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of IntegersSusantha Herath
 
Section 12 ; Article 2
Section 12 ; Article 2 Section 12 ; Article 2
Section 12 ; Article 2 Shayne Galo
 
Data communication & network - ADSL
Data communication & network - ADSLData communication & network - ADSL
Data communication & network - ADSLReformist
 
Autism: Makaton, Visuals and Timetabling
Autism: Makaton, Visuals and Timetabling Autism: Makaton, Visuals and Timetabling
Autism: Makaton, Visuals and Timetabling SEND_CDPSSouthwark
 
Timeline History of the Internet
Timeline History of the InternetTimeline History of the Internet
Timeline History of the InternetAven Mercado
 
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng Wika
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng WikaHeograpikal,Morpolohikal at Ponolohikal na Varayti ng Wika
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng WikaRochelle Nato
 
Binary Slides
Binary Slides Binary Slides
Binary Slides jnoles
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbersatcnerd
 
Satellite communication
Satellite communicationSatellite communication
Satellite communicationaditi sehgal
 

What's hot (20)

Analog and digital signals
Analog and digital signalsAnalog and digital signals
Analog and digital signals
 
Ra 7925
Ra 7925Ra 7925
Ra 7925
 
Verbal
VerbalVerbal
Verbal
 
Don't care conditions
Don't care conditionsDon't care conditions
Don't care conditions
 
Parabola
ParabolaParabola
Parabola
 
Real life application of Function.
Real life application of Function.Real life application of Function.
Real life application of Function.
 
Logic gates ppt
Logic gates pptLogic gates ppt
Logic gates ppt
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Binary
BinaryBinary
Binary
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Section 12 ; Article 2
Section 12 ; Article 2 Section 12 ; Article 2
Section 12 ; Article 2
 
Data communication & network - ADSL
Data communication & network - ADSLData communication & network - ADSL
Data communication & network - ADSL
 
Autism: Makaton, Visuals and Timetabling
Autism: Makaton, Visuals and Timetabling Autism: Makaton, Visuals and Timetabling
Autism: Makaton, Visuals and Timetabling
 
Timeline History of the Internet
Timeline History of the InternetTimeline History of the Internet
Timeline History of the Internet
 
Binary code
Binary codeBinary code
Binary code
 
Radio waves
Radio wavesRadio waves
Radio waves
 
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng Wika
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng WikaHeograpikal,Morpolohikal at Ponolohikal na Varayti ng Wika
Heograpikal,Morpolohikal at Ponolohikal na Varayti ng Wika
 
Binary Slides
Binary Slides Binary Slides
Binary Slides
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbers
 
Satellite communication
Satellite communicationSatellite communication
Satellite communication
 

Viewers also liked (9)

Presentacin2
Presentacin2Presentacin2
Presentacin2
 
Commercial Data Processing Intro
Commercial Data Processing IntroCommercial Data Processing Intro
Commercial Data Processing Intro
 
Binary
BinaryBinary
Binary
 
Presentation VIP CONSULT LTD 12.4
Presentation VIP CONSULT LTD  12.4Presentation VIP CONSULT LTD  12.4
Presentation VIP CONSULT LTD 12.4
 
Presentacin2
Presentacin2Presentacin2
Presentacin2
 
신일동창회보 68호
신일동창회보 68호신일동창회보 68호
신일동창회보 68호
 
VIP CONSULT LTD 2011.14
VIP CONSULT LTD  2011.14VIP CONSULT LTD  2011.14
VIP CONSULT LTD 2011.14
 
Presentacin2
Presentacin2Presentacin2
Presentacin2
 
Presentation vip consult ltd 15 standart
Presentation vip consult ltd 15 standartPresentation vip consult ltd 15 standart
Presentation vip consult ltd 15 standart
 

Similar to Integers

Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representationekul
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data RepresentationKyle
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.pptzorogoh2
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdfAsthaChaurasia4
 
Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representationiarthur
 
Network Slides
Network SlidesNetwork Slides
Network Slidesiarthur
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdfmiftah88
 
Int 2 data representation 2010
Int 2 data representation 2010Int 2 data representation 2010
Int 2 data representation 2010iarthur
 
Presentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxPresentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxMinahilUmar1
 
Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...ArtemKovera
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1DIGDARSHAN KUNWAR
 
Data repersentation.
Data repersentation.Data repersentation.
Data repersentation.Ritesh Saini
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptxHamnaKhalid25
 
Data representation
Data representationData representation
Data representationManish Kumar
 

Similar to Integers (20)

Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Number System and Boolean Algebra
Number System and Boolean AlgebraNumber System and Boolean Algebra
Number System and Boolean Algebra
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Computer Number system
Computer Number systemComputer Number system
Computer Number system
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdf
 
Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representation
 
Network Slides
Network SlidesNetwork Slides
Network Slides
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
Int 2 data representation 2010
Int 2 data representation 2010Int 2 data representation 2010
Int 2 data representation 2010
 
Presentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxPresentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptx
 
NUMBER SYSTEM.pptx
NUMBER  SYSTEM.pptxNUMBER  SYSTEM.pptx
NUMBER SYSTEM.pptx
 
Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1
 
Ch 4
Ch 4Ch 4
Ch 4
 
Data repersentation.
Data repersentation.Data repersentation.
Data repersentation.
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
Data representation
Data representationData representation
Data representation
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

Integers

  • 1. An integer is a whole number, positive or negative. Every integer stored in the computer is allocated the same amount of space, whether it is a large integer or a small integer. The number of bits allocated determines the range of numbers which can be stored. If one byte was allowed then the largest integer would be: 11111111 which is 255 in decimal or 28 - 1 Two bytes would allow: 216 -1 possibilities = a range from 0 to 65535. Integers
  • 2. If a computer only had to store positive integers then we could easily convert each number into its binary equivalent as you saw in the examples earlier. However, negative numbers have to be stored too and we need to find a method of representing a –ve sign using 1s and 0s. Modern computers use the Two’s complement method to represent integers. Negative Integers
  • 3. With this method we take the most significant bit (the one on the far left) and treat it as a negative number . The following examples illustrate the principle using 4 bit numbers to help you understand. A modern computer would use 32 bit numbers for integers. In your NABS and final exams you are likely to be asked to use 8 bit number. Two's Complement
  • 4. Binary Decimal 1000 -8 1001 -7 1010 -6 1011 -5 1100 -4 1101 -3 1110 -2 1111 -1 0000 0 0001 +1 0010 +2 0011 +3 0100 +4 0101 +5 0110 +6 0111 +7 In this table the 1 at the far left represents -8 (negative 8). Make sure that you understand this concept Note that the range is still 2 4 = 16 numbers = -8 to +7 Two’s Complement
  • 5. Range and Accuracy of Two’s Complement 1. The range of numbers which can be stored depends on the number of bits being used. 4 bit numbers have a range 8 bit numbers have a range -8 to +7 -128 to +127 3. Numbers stored using two’s complement are always 100% accurate . 2. In a modern computer 32 bits are used stored integers. This gives a range of 2 32 around -2,147,483,648 to +2,147,483,647
  • 6. 8 Bit Two’s complement numbers Here is an example of how to work out the Two’s complement for the number -80 -80 = -128 64 32 16 8 4 2 1 1 0 0 1 1 0 0 0 1. The number is negative so put a 1 in the first column. 128 80 48 2. Subtract the 80 from 128. 3. Now make 48 from the remaining columns using normal binary rules. 32 16 16 0