SlideShare a Scribd company logo
Software Developers View of Hardware Integer Representation
Syllabus Integer Representation, including: Sign and modulus One’s complement Two’s complement Representation of Fractions Floating point or real. IEEE
What is Integer Representation About? To fully understand how binary numbers are processed we must have an understanding of how integers are handled by the computer. For example: How are negative numbers represented? How are floating point numbers represented? Processing – How do we add, subtract, divide and multiply?
How can we represent a binary number? ?????? Maybe - 000111001 NO
How can we represent a binary number? Binary number can only be represented by a 0 or 1, so we cannot use a (-) to denote a negative number. Therefore, we cannot use a specialised symbol so it must be either a 0 or 1. There are THREE methods used, they are:
Sign and Modulus This method uses the far left-hand bit which is often referred to as the sign bit. The general rule is that a positive number starts with 0 and a negative number starts with a 1. + 28 = 0 0011100 SIGN Modulus
ACTIVITY 1 Using ONE byte what is the maximum positive and negative integer that can represented using sign and modulus. Convert the following numbers to binary using sign and modulus. 122 -100 -264
One’s Complement What is a complement ? It is the opposite of something. Because computers do not like to subtract, this method finds the complement of a positive number and then addition can take place. -127 -75 0 75 127
One’s Complement Example Find the one’s complement of +100 Convert +100 to binary. Swap all the bits. Check answer by adding -127 to your result.
One’s Complement Example +100 = 01100100 2 01100100 2 10011011 2 10011011 2  = -27 10 127 10  + -27 10  = 100 10 127 -127 65 -62 -27 100
ACTIVITY 2 Convert the following binary numbers into a negative using one’s complement. 0110111 2 00110011 2
Two’s Complement The only difference between the two processes is that the left most bit is -128 10  rather than -127 10 . The process for two’s complement is exactly the same as one’s complement, however you are then required to add 1 to the results.
Two’s Complement Example Find the two’s complement of +15 10 Convert +15 10  to binary. Swap all the bits. Add 1 to the result.
Two’s Complement Example +15 = 00001111 2 00001111 2 11110000 2 11110000 2  +   1 11110001 -128 + 64 + 32 + 16 + 1 = -15 10
Two’s Complement Rules for Adding 1 + 1 = 0 (Carry the 1) 0 + 0 = 0 0 + 1 = 1
ACTIVITY 3 Convert the following binary numbers into a negative using two’s complement. 00101110 2  01101000 2 01011011 2 A computer has a word length of 8 binary digits and uses two’s complement. Translate -82 10  into a form a computer would use.
Answers 00101110 - 11010010 01101000 - 10011000 01011011 - 10100101
ANSWER Translate 82 10  into binary = 01010010 2 Reverse all the bits so that 0’s become 1’s and 1’s become 0’s. 10101101 = -82 10  in one’s complement. Complete two’s complement. Answer = 10101110 2
Representation of Fractions What are they? Fractional numbers are numbers between 0 and 1. They are called real numbers in computing terms. Real numbers contain both an integer and fractional part. E.g. 23.714 OR 01101.1001
Methods Used: Computers use two main methods to represent real numbers: They are: Fixed point Floating point
Fixed Point This method assumes the decimal point is in a fixed position. Relies on using a fixed number of bits for both the integer and fractional parts  i.e. 5 and 3. Example 10011101 = 10011.101
Fixed Point Therefore 16 + 2 + 1 = 19 (Integer) 0.5 + 0.125 = 0.625 (Fraction) So 10011.101 = 19.625 1 0 1 1 1 0 0 1 0.125 0.25 0.5 1 2 4 8 16 Fractional Integer
Fixed Point Problems are: You fix the numbers that you can represent i.e. you are limited to amount of numbers that you can actually represent.
Activity 4 Convert the following binary numbers to decimal. 101.11 110.101 Convert the following decimal numbers to binary. 2.25 0.875
Activity 4 Identify what number 11001101 would represent in the integer /fractional ratio was: a. 6:2 b. 5:3 c: 4:4
Floating Point This is the preferred method because you can represent large numbers. This uses exponential notation which highlights two specific parts of a decimal number: Mantissa –  Fractional part. Exponent –  Is the power by 10 which the mantissa is multiplied.
Floating Point Example -241.65 = -0.24165 x 10 3 0.0028 =  0.28 x 10 -2 110.11 = 0.11011 x 2 3 The aim of floating point representation is show how many numbers before or after the decimal point.
Activity 5 Identify the floating point representation of the following numbers. 3776.56 10001.11 0.0000010100 10.001001
Floating Point But there is more! A computer will represent a binary number into THREE parts: Sign Bit Mantissa Exponent
Floating Point Convert the following binary number to decimal using floating point notation. 01101011 Sign Bit Mantissa Exponent
Floating Point Steps Convert the mantissa to decimal. 0.5 + 0.25 + 0.0625 = 0.8125 1 0.0625 0 1 1 0.125 0.25 0.5
Floating Point Steps Convert the exponent. 011 = 3 Therefore 2 3  = 8 0.8125 x 8 = 6.5 Answer = 6.5
Floating Point More on Floating Point Numbers The Institute of Electrical and Electronics Engineers has produced a standard for representing binary numbers using the floating point system. IEEE 32 bit IEEE 64 bit
IEEE 32 Bit 1 11001010 00000000000000000011001 32 Bits Sign Bit (1 bit) Exponent (8 bits) Mantissa (23 bits)
IEEE 32 Bit Example  – Convert 24.25 to an IEEE 32 bit number. Convert 24.25 to  binary. 24.25 = 11000.01 Normalise 11000.01 = 1.100001 x 2 4   Determine the sign bit, mantissa and exponent.
IEEE 32 Bit Sign Bit = 0 (Because it is a + number) Mantissa = 100001 Exponent = 127 (Largest) + 4 = 131 0  10000011  00000000000000000010001
Activity 6 Convert the following number using IEEE 32 bit format. 418.125

More Related Content

PPTX
mathematical functions
PPT
Java Threads
PPTX
What Is User Datagram Protocol?
PPT
PPTX
Digital electronics logic families
PDF
What is UI/UX and the Difference
PPTX
ROM (Read Only Memory)
PPTX
Floating point representation
mathematical functions
Java Threads
What Is User Datagram Protocol?
Digital electronics logic families
What is UI/UX and the Difference
ROM (Read Only Memory)
Floating point representation

What's hot (20)

PPTX
Quick tutorial on IEEE 754 FLOATING POINT representation
PPTX
Data Representation
PPTX
PPSX
Fixed point and floating-point numbers
PPTX
Booth’s algorithm.(a014& a015)
PPTX
IEEE floating point representation
PPTX
Number system in Digital Electronics
PPTX
Number system conversion
PPTX
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
PPT
DATA REPRESENTATION
PPTX
Floating point arithmetic operations (1)
PDF
Binary Arithmetic Operations
PPTX
PPTX
Binary Arithmetic
PDF
Instruction cycle
PPT
Binary Arithmetic
PPTX
1s and 2s complement
PPTX
Addressing modes
PPTX
Multiplication algorithm, hardware and flowchart
PPTX
What is Gray Code?
Quick tutorial on IEEE 754 FLOATING POINT representation
Data Representation
Fixed point and floating-point numbers
Booth’s algorithm.(a014& a015)
IEEE floating point representation
Number system in Digital Electronics
Number system conversion
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
DATA REPRESENTATION
Floating point arithmetic operations (1)
Binary Arithmetic Operations
Binary Arithmetic
Instruction cycle
Binary Arithmetic
1s and 2s complement
Addressing modes
Multiplication algorithm, hardware and flowchart
What is Gray Code?
Ad

Similar to Integer Representation (20)

PPT
3.Fixed-Floating Point.ppt
PDF
IN 1300 LEC_D02(B15) Basic electronic 2.pdf
PDF
FIXED and FLOATING-POINT-REPRESENTATION.pdf
PDF
Representasi Data, SISTEM BILANGAN, KODE BILANGAN
PPT
Number_Systems in Digital Logic Design CS-151
PPT
Chapter 2 Data Representation on CPU (part 1)
PDF
LEC-3-CAO-FLOATING-POINT-REPRESENTATION.pdf
PPT
Representation of Negative Numbers
PPTX
Number Sytem Conversion & Binary Arithmetics.pptx
PPT
chapter 3 000Number_Systems.ppt
PPTX
Number system
PPTX
DATA REPRESENTATION.pptx
PPTX
csc221_lecture_03_datarepresentation_02.pptx
PPT
09 Arithmetic
PDF
uyuyuy.pdf
RTF
DCF QNA edited
PDF
Binaty Arithmetic and Binary coding schemes
DOCX
Lesson plan on data representation
PPTX
number system
3.Fixed-Floating Point.ppt
IN 1300 LEC_D02(B15) Basic electronic 2.pdf
FIXED and FLOATING-POINT-REPRESENTATION.pdf
Representasi Data, SISTEM BILANGAN, KODE BILANGAN
Number_Systems in Digital Logic Design CS-151
Chapter 2 Data Representation on CPU (part 1)
LEC-3-CAO-FLOATING-POINT-REPRESENTATION.pdf
Representation of Negative Numbers
Number Sytem Conversion & Binary Arithmetics.pptx
chapter 3 000Number_Systems.ppt
Number system
DATA REPRESENTATION.pptx
csc221_lecture_03_datarepresentation_02.pptx
09 Arithmetic
uyuyuy.pdf
DCF QNA edited
Binaty Arithmetic and Binary coding schemes
Lesson plan on data representation
number system
Ad

More from gavhays (18)

PPT
Data types
PPT
End user development
PPT
Representation Of Data
PPT
N301 Designing Circuits
PPT
Understanding Flip Flops
PPT
Programming Hardware Devices
PPT
Plp
PPT
Electronic Circuits
PPT
Boolean Algebra
PPT
Sdd Maintenance Of Software Solutions
PPT
Sdd Documentation
PPT
Testing Software Solutions
PPT
Reporting On The Testing Process
PPT
S D D Program Development Tools
PPT
SDD Translation
PPT
The Role Of The Cpu
PPT
Sdd Syntax Descriptions
PPT
Interface Design
Data types
End user development
Representation Of Data
N301 Designing Circuits
Understanding Flip Flops
Programming Hardware Devices
Plp
Electronic Circuits
Boolean Algebra
Sdd Maintenance Of Software Solutions
Sdd Documentation
Testing Software Solutions
Reporting On The Testing Process
S D D Program Development Tools
SDD Translation
The Role Of The Cpu
Sdd Syntax Descriptions
Interface Design

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Tartificialntelligence_presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Programs and apps: productivity, graphics, security and other tools
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Tartificialntelligence_presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Getting Started with Data Integration: FME Form 101
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Integer Representation

  • 1. Software Developers View of Hardware Integer Representation
  • 2. Syllabus Integer Representation, including: Sign and modulus One’s complement Two’s complement Representation of Fractions Floating point or real. IEEE
  • 3. What is Integer Representation About? To fully understand how binary numbers are processed we must have an understanding of how integers are handled by the computer. For example: How are negative numbers represented? How are floating point numbers represented? Processing – How do we add, subtract, divide and multiply?
  • 4. How can we represent a binary number? ?????? Maybe - 000111001 NO
  • 5. How can we represent a binary number? Binary number can only be represented by a 0 or 1, so we cannot use a (-) to denote a negative number. Therefore, we cannot use a specialised symbol so it must be either a 0 or 1. There are THREE methods used, they are:
  • 6. Sign and Modulus This method uses the far left-hand bit which is often referred to as the sign bit. The general rule is that a positive number starts with 0 and a negative number starts with a 1. + 28 = 0 0011100 SIGN Modulus
  • 7. ACTIVITY 1 Using ONE byte what is the maximum positive and negative integer that can represented using sign and modulus. Convert the following numbers to binary using sign and modulus. 122 -100 -264
  • 8. One’s Complement What is a complement ? It is the opposite of something. Because computers do not like to subtract, this method finds the complement of a positive number and then addition can take place. -127 -75 0 75 127
  • 9. One’s Complement Example Find the one’s complement of +100 Convert +100 to binary. Swap all the bits. Check answer by adding -127 to your result.
  • 10. One’s Complement Example +100 = 01100100 2 01100100 2 10011011 2 10011011 2 = -27 10 127 10 + -27 10 = 100 10 127 -127 65 -62 -27 100
  • 11. ACTIVITY 2 Convert the following binary numbers into a negative using one’s complement. 0110111 2 00110011 2
  • 12. Two’s Complement The only difference between the two processes is that the left most bit is -128 10 rather than -127 10 . The process for two’s complement is exactly the same as one’s complement, however you are then required to add 1 to the results.
  • 13. Two’s Complement Example Find the two’s complement of +15 10 Convert +15 10 to binary. Swap all the bits. Add 1 to the result.
  • 14. Two’s Complement Example +15 = 00001111 2 00001111 2 11110000 2 11110000 2 + 1 11110001 -128 + 64 + 32 + 16 + 1 = -15 10
  • 15. Two’s Complement Rules for Adding 1 + 1 = 0 (Carry the 1) 0 + 0 = 0 0 + 1 = 1
  • 16. ACTIVITY 3 Convert the following binary numbers into a negative using two’s complement. 00101110 2 01101000 2 01011011 2 A computer has a word length of 8 binary digits and uses two’s complement. Translate -82 10 into a form a computer would use.
  • 17. Answers 00101110 - 11010010 01101000 - 10011000 01011011 - 10100101
  • 18. ANSWER Translate 82 10 into binary = 01010010 2 Reverse all the bits so that 0’s become 1’s and 1’s become 0’s. 10101101 = -82 10 in one’s complement. Complete two’s complement. Answer = 10101110 2
  • 19. Representation of Fractions What are they? Fractional numbers are numbers between 0 and 1. They are called real numbers in computing terms. Real numbers contain both an integer and fractional part. E.g. 23.714 OR 01101.1001
  • 20. Methods Used: Computers use two main methods to represent real numbers: They are: Fixed point Floating point
  • 21. Fixed Point This method assumes the decimal point is in a fixed position. Relies on using a fixed number of bits for both the integer and fractional parts i.e. 5 and 3. Example 10011101 = 10011.101
  • 22. Fixed Point Therefore 16 + 2 + 1 = 19 (Integer) 0.5 + 0.125 = 0.625 (Fraction) So 10011.101 = 19.625 1 0 1 1 1 0 0 1 0.125 0.25 0.5 1 2 4 8 16 Fractional Integer
  • 23. Fixed Point Problems are: You fix the numbers that you can represent i.e. you are limited to amount of numbers that you can actually represent.
  • 24. Activity 4 Convert the following binary numbers to decimal. 101.11 110.101 Convert the following decimal numbers to binary. 2.25 0.875
  • 25. Activity 4 Identify what number 11001101 would represent in the integer /fractional ratio was: a. 6:2 b. 5:3 c: 4:4
  • 26. Floating Point This is the preferred method because you can represent large numbers. This uses exponential notation which highlights two specific parts of a decimal number: Mantissa – Fractional part. Exponent – Is the power by 10 which the mantissa is multiplied.
  • 27. Floating Point Example -241.65 = -0.24165 x 10 3 0.0028 = 0.28 x 10 -2 110.11 = 0.11011 x 2 3 The aim of floating point representation is show how many numbers before or after the decimal point.
  • 28. Activity 5 Identify the floating point representation of the following numbers. 3776.56 10001.11 0.0000010100 10.001001
  • 29. Floating Point But there is more! A computer will represent a binary number into THREE parts: Sign Bit Mantissa Exponent
  • 30. Floating Point Convert the following binary number to decimal using floating point notation. 01101011 Sign Bit Mantissa Exponent
  • 31. Floating Point Steps Convert the mantissa to decimal. 0.5 + 0.25 + 0.0625 = 0.8125 1 0.0625 0 1 1 0.125 0.25 0.5
  • 32. Floating Point Steps Convert the exponent. 011 = 3 Therefore 2 3 = 8 0.8125 x 8 = 6.5 Answer = 6.5
  • 33. Floating Point More on Floating Point Numbers The Institute of Electrical and Electronics Engineers has produced a standard for representing binary numbers using the floating point system. IEEE 32 bit IEEE 64 bit
  • 34. IEEE 32 Bit 1 11001010 00000000000000000011001 32 Bits Sign Bit (1 bit) Exponent (8 bits) Mantissa (23 bits)
  • 35. IEEE 32 Bit Example – Convert 24.25 to an IEEE 32 bit number. Convert 24.25 to binary. 24.25 = 11000.01 Normalise 11000.01 = 1.100001 x 2 4 Determine the sign bit, mantissa and exponent.
  • 36. IEEE 32 Bit Sign Bit = 0 (Because it is a + number) Mantissa = 100001 Exponent = 127 (Largest) + 4 = 131 0 10000011 00000000000000000010001
  • 37. Activity 6 Convert the following number using IEEE 32 bit format. 418.125