SlideShare a Scribd company logo
1 of 19
Representation Of Numbers and
Characters
Our Presentation
Topic is
Our Group Members are:
Name Id
Mohammad Obaedul Islam 4080
Shaikh Kamrul Islam 3814
Debashish Mondal 3709
Ashraful Alam Sabbir 4086
Outline
• Introduction
• Numbering Systems
• Binary & Hexadecimal Numbers
• Binary and Hexadecimal Addition
• Binary and Hexadecimal subtraction
• Base Conversions
Introduction
• Computers only deal with binary data (0s and 1s), hence all
data manipulated by computers must be represented in
binary format.
• Machine instructions manipulate many different forms of
data:
– Numbers:
• Integers: 33, +128, -2827
• Real numbers: 1.33, +9.55609, -6.76E12, +4.33E-03
– Alphanumeric characters (letters, numbers, signs, control
characters): examples: A, a, c, 1 ,3, ", +, Ctrl, Shift, etc.
• So in general we have two major data types that need to be
represented in computers; numbers and characters
Number System
• Numbering systems are characterized by their base
number.
• In general a numbering system with a base r will have r
different digits (including the 0) in its number set. These
digits will range from 0 to r-1
• The most widely used numbering systems are listed in
the table below:
Conversion of Number System:
Binary Numbers
• Each digit (bit) is either 1 or 0
• Each bit represents a power of 2
• Every binary number is a sum of powers of 2
Binary 10101001 = decimal 169
Conversion :(1  27) + (1  25) + (1  23) + (1  20)
= 128+32+8+1=169
1 1 1 1 1 1 1 1
27 26 25 24 23 22 21 20
Converting from Decimal fractions to Binary:
• Converting 0.8125 to binary . . .
– Ignoring the value in the units
place at each step, continue
multiplying each fractional part
by the radix.
– You are finished when the
product is zero, or until you have
reached the desired number of
binary places.
– Our result, reading from top to
bottom is:
0.812510 = 0.11012
– This method also works with any
base. Just use the target radix as
the multiplier.
Hexadecimal Integers
• Each hexadecimal digit corresponds to 4 binary bits.
• Example: Translate the binary integer
000101101010011110010100 to hexadecimal
Binary values are represented in hexadecimal.
Converting Binary to Hexadecimal
• Multiply each digit by its corresponding power of 16:
• Examples:
– Hex 1234 = (1  163) + (2  162) + (3  161) + (4  160) =
Decimal 4,660
– Hex 3BA4 = (3  163) + (11 * 162) + (10  161) + (4  160) =
Decimal 15,268
Converting Hexadecimal to
Decimal
Converting Hexadecimal to
Binary• Each Hexadecimal digit can be replaced by its 4-bit binary
number to form the binary equivalent.
Binary Addition
• Start with the least significant bit (rightmost bit)
• Add each pair of bits
• Include the carry in the addition, if present
0 0 0 0 0 1 1 1
0 0 0 0 0 1 0 0
+
0 0 0 0 1 0 1 1
1
(4)
(7)
(11)
carry:
01234bit position: 567
Hexadecimal Addition
• Divide the sum of two digits by the number base (16). The quotient
becomes the carry value, and the remainder is the sum digit.
36 28 28 6A
42 45 58 4B
78 6D 80 B5
11
21 / 16 = 1, remainder 5
Important skill: Programmers frequently add and subtract the addresses
of variables and instructions.
Binary Subtraction
• Rules of Binary Subtraction
0 - 0 = 0
0 - 1 = 1, and borrow 1 from the next more significant bit
1 - 0 = 1
1 - 1 = 0
• For example,
00100101- 00010001=00010100 0 borrows
0 0 1 10 0 1 0 1 = 37(base 10)
- 0 0 0 1 0 0 0 1 = 17(base 10)
0 0 0 1 0 1 0 0 = 20(base 10)
When a borrow is required from the digit to the left,
add 16 (decimal) to the current digit's value
Hexadecimal Subtraction
C675
A247
242E
-1
-
16 + 5 = 21
C675
5DB9 (2's complement)
242E (same result)
1
+
1
• There are three ways in which signed binary numbers
may be expressed:
– Signed magnitude,
– One’s complement and
– Two’s complement.
• In an 8-bit word, signed magnitude representation places
the absolute value of the number in the 7 bits to the
right of the sign bit.
• For example, in 8-bit signed magnitude, positive 3 is:
00000011
• Negative 3 is: 10000011
Signed Integer Representation
One's Complement
• The one's complement of an integer is obtained by
complementing each bit; that is, replace each 0 by a 1 and
each 1 by a O. In the following , we assume numbers are 16
bits.
• Example : Find the one's complement of 5 =
0000000000000101.
Solution: 5= OOOOOOOOOO0OO I 0 I
One's complement of 5 = 1111111111111010
Note that if we add 5 and its one's complement, we get
1111111111111111.
Two's Complement
Representation
• Start at the least significant digit, leaving all the
0s unchanged, look for the first occurrence of a
non-zero digit.
Example: Find the two's complement of the 5.
Solution:
5=00000000000000101
Ones complement of 5 =1111111111111010
+1
two's complement of 5 = 1111111111111011
Here is my basic idea of how the program should
be structured in number system:
• org 100h
• mov al, 00000101b ; (hex: 5h)
mov bl, 0ah
• mov cl, 10o
• Add al, bl ; 5 + 10 = 15 (0fh) ; 15 - 8 = 7
• sub al, cl
• mov bl, al ; print result in binary:
• mov cx, 8
• print:
• mov ah, 2 ; print function.
• mov dl, '0'
• test bl, 10000000b ; test first bit.
• jz zero
• mov dl, '1'
• zero:
• int 21h
• shl bl, 1
• loop print
• mov dl, 'b'
• int 21h
• mov ah, 0
• int 16h
• ret
THANK YOU ALL

More Related Content

What's hot

Number System in CoMpUtEr
Number System in CoMpUtErNumber System in CoMpUtEr
Number System in CoMpUtErvishal bansal
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbersatcnerd
 
binary number system
 binary number system binary number system
binary number systemvishal gupta
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number systemNallapati Anindra
 
Number system
Number systemNumber system
Number systemkashee99
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & DecoderSyed Saeed
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
Number system....
Number system....Number system....
Number system....mshoaib15
 
Introduction to binary number system
Introduction to binary number systemIntroduction to binary number system
Introduction to binary number systemVikas Dongre
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 

What's hot (20)

Number System
Number SystemNumber System
Number System
 
Number System in CoMpUtEr
Number System in CoMpUtErNumber System in CoMpUtEr
Number System in CoMpUtEr
 
Computer Number system
Computer Number systemComputer Number system
Computer Number system
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbers
 
1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL
 
binary number system
 binary number system binary number system
binary number system
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 
Number system
Number systemNumber system
Number system
 
13 Boolean Algebra
13 Boolean Algebra13 Boolean Algebra
13 Boolean Algebra
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & Decoder
 
Number system
Number systemNumber system
Number system
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Number system of computer
Number system of computerNumber system of computer
Number system of computer
 
Number system....
Number system....Number system....
Number system....
 
Number system
Number systemNumber system
Number system
 
Data representation
Data representationData representation
Data representation
 
Introduction to binary number system
Introduction to binary number systemIntroduction to binary number system
Introduction to binary number system
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 

Viewers also liked

Annual Report 2012 of World Vision Bangladesh
Annual Report 2012 of World Vision BangladeshAnnual Report 2012 of World Vision Bangladesh
Annual Report 2012 of World Vision BangladeshMahmudul Hasan
 
Overcoming the challenges of IT Training in Non-English speaking countries
Overcoming the challenges of IT Training in Non-English speaking countriesOvercoming the challenges of IT Training in Non-English speaking countries
Overcoming the challenges of IT Training in Non-English speaking countriesIIHT Technologies
 
Zurich, march 2013
Zurich, march 2013Zurich, march 2013
Zurich, march 2013Jasim Rony
 
IIHT Franchise Consulted for Skill Upgradation
IIHT Franchise Consulted for Skill UpgradationIIHT Franchise Consulted for Skill Upgradation
IIHT Franchise Consulted for Skill UpgradationIIHT Technologies
 
20 countries information
20 countries information20 countries information
20 countries informationSamiuR RahmaN
 
Food, water , energy nexus, presentation golam rasul, senior economist
Food, water , energy nexus,  presentation golam rasul, senior economistFood, water , energy nexus,  presentation golam rasul, senior economist
Food, water , energy nexus, presentation golam rasul, senior economistICIMOD
 
Food, water, energy nexus as an adaptation mechanism golam rasul
Food, water, energy nexus as an adaptation mechanism golam rasulFood, water, energy nexus as an adaptation mechanism golam rasul
Food, water, energy nexus as an adaptation mechanism golam rasulICIMOD
 
Sectors of developing bangladesh and the problems behind it and the remedy of...
Sectors of developing bangladesh and the problems behind it and the remedy of...Sectors of developing bangladesh and the problems behind it and the remedy of...
Sectors of developing bangladesh and the problems behind it and the remedy of...SamiuR RahmaN
 
Letter of credit for Finance
Letter of credit for FinanceLetter of credit for Finance
Letter of credit for FinanceSamiuR RahmaN
 
Cloud Storage and Business
Cloud Storage and BusinessCloud Storage and Business
Cloud Storage and BusinessShakib Shikto
 
Food security & livelihoods golam rasul, senior economist
Food security & livelihoods   golam rasul, senior economist Food security & livelihoods   golam rasul, senior economist
Food security & livelihoods golam rasul, senior economist ICIMOD
 
Socio economic development, gender and ecotourism in myanmar golam rasul
Socio economic development, gender  and ecotourism in myanmar  golam rasulSocio economic development, gender  and ecotourism in myanmar  golam rasul
Socio economic development, gender and ecotourism in myanmar golam rasulICIMOD
 
7th five year plan & development vision for cht golam rasul icimod
7th five year plan & development vision for cht golam rasul icimod7th five year plan & development vision for cht golam rasul icimod
7th five year plan & development vision for cht golam rasul icimodICIMOD
 
British rule in bengal
British rule in bengalBritish rule in bengal
British rule in bengalsaurov77
 

Viewers also liked (20)

Social networking
Social networkingSocial networking
Social networking
 
Annual Report 2012 of World Vision Bangladesh
Annual Report 2012 of World Vision BangladeshAnnual Report 2012 of World Vision Bangladesh
Annual Report 2012 of World Vision Bangladesh
 
Overcoming the challenges of IT Training in Non-English speaking countries
Overcoming the challenges of IT Training in Non-English speaking countriesOvercoming the challenges of IT Training in Non-English speaking countries
Overcoming the challenges of IT Training in Non-English speaking countries
 
Zurich, march 2013
Zurich, march 2013Zurich, march 2013
Zurich, march 2013
 
Hsc english paper_ii_model test
Hsc english paper_ii_model testHsc english paper_ii_model test
Hsc english paper_ii_model test
 
IIHT Franchise Consulted for Skill Upgradation
IIHT Franchise Consulted for Skill UpgradationIIHT Franchise Consulted for Skill Upgradation
IIHT Franchise Consulted for Skill Upgradation
 
20 countries information
20 countries information20 countries information
20 countries information
 
Food, water , energy nexus, presentation golam rasul, senior economist
Food, water , energy nexus,  presentation golam rasul, senior economistFood, water , energy nexus,  presentation golam rasul, senior economist
Food, water , energy nexus, presentation golam rasul, senior economist
 
Angry birds math
Angry birds mathAngry birds math
Angry birds math
 
Food, water, energy nexus as an adaptation mechanism golam rasul
Food, water, energy nexus as an adaptation mechanism golam rasulFood, water, energy nexus as an adaptation mechanism golam rasul
Food, water, energy nexus as an adaptation mechanism golam rasul
 
Sectors of developing bangladesh and the problems behind it and the remedy of...
Sectors of developing bangladesh and the problems behind it and the remedy of...Sectors of developing bangladesh and the problems behind it and the remedy of...
Sectors of developing bangladesh and the problems behind it and the remedy of...
 
Vision 2021
Vision 2021Vision 2021
Vision 2021
 
Letter of credit for Finance
Letter of credit for FinanceLetter of credit for Finance
Letter of credit for Finance
 
Cloud Storage and Business
Cloud Storage and BusinessCloud Storage and Business
Cloud Storage and Business
 
Secret to franchise success
Secret to franchise successSecret to franchise success
Secret to franchise success
 
Food security & livelihoods golam rasul, senior economist
Food security & livelihoods   golam rasul, senior economist Food security & livelihoods   golam rasul, senior economist
Food security & livelihoods golam rasul, senior economist
 
Socio economic development, gender and ecotourism in myanmar golam rasul
Socio economic development, gender  and ecotourism in myanmar  golam rasulSocio economic development, gender  and ecotourism in myanmar  golam rasul
Socio economic development, gender and ecotourism in myanmar golam rasul
 
7th five year plan & development vision for cht golam rasul icimod
7th five year plan & development vision for cht golam rasul icimod7th five year plan & development vision for cht golam rasul icimod
7th five year plan & development vision for cht golam rasul icimod
 
British rule in bengal
British rule in bengalBritish rule in bengal
British rule in bengal
 
Bangladesh studies vision 2041
Bangladesh studies vision 2041Bangladesh studies vision 2041
Bangladesh studies vision 2041
 

Similar to Representation Of Numbers and Characters

Similar to Representation Of Numbers and Characters (20)

data representation
 data representation data representation
data representation
 
Alu1
Alu1Alu1
Alu1
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Lecture 2 ns
Lecture 2 nsLecture 2 ns
Lecture 2 ns
 
02 number systems
02 number systems02 number systems
02 number systems
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversions
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Cit 1101 lec 02
Cit 1101 lec 02Cit 1101 lec 02
Cit 1101 lec 02
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Course Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdfCourse Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdf
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 

Recently uploaded

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

Representation Of Numbers and Characters

  • 1. Representation Of Numbers and Characters Our Presentation Topic is
  • 2. Our Group Members are: Name Id Mohammad Obaedul Islam 4080 Shaikh Kamrul Islam 3814 Debashish Mondal 3709 Ashraful Alam Sabbir 4086
  • 3. Outline • Introduction • Numbering Systems • Binary & Hexadecimal Numbers • Binary and Hexadecimal Addition • Binary and Hexadecimal subtraction • Base Conversions
  • 4. Introduction • Computers only deal with binary data (0s and 1s), hence all data manipulated by computers must be represented in binary format. • Machine instructions manipulate many different forms of data: – Numbers: • Integers: 33, +128, -2827 • Real numbers: 1.33, +9.55609, -6.76E12, +4.33E-03 – Alphanumeric characters (letters, numbers, signs, control characters): examples: A, a, c, 1 ,3, ", +, Ctrl, Shift, etc. • So in general we have two major data types that need to be represented in computers; numbers and characters
  • 5. Number System • Numbering systems are characterized by their base number. • In general a numbering system with a base r will have r different digits (including the 0) in its number set. These digits will range from 0 to r-1 • The most widely used numbering systems are listed in the table below:
  • 7. Binary Numbers • Each digit (bit) is either 1 or 0 • Each bit represents a power of 2 • Every binary number is a sum of powers of 2 Binary 10101001 = decimal 169 Conversion :(1  27) + (1  25) + (1  23) + (1  20) = 128+32+8+1=169 1 1 1 1 1 1 1 1 27 26 25 24 23 22 21 20
  • 8. Converting from Decimal fractions to Binary: • Converting 0.8125 to binary . . . – Ignoring the value in the units place at each step, continue multiplying each fractional part by the radix. – You are finished when the product is zero, or until you have reached the desired number of binary places. – Our result, reading from top to bottom is: 0.812510 = 0.11012 – This method also works with any base. Just use the target radix as the multiplier.
  • 9. Hexadecimal Integers • Each hexadecimal digit corresponds to 4 binary bits. • Example: Translate the binary integer 000101101010011110010100 to hexadecimal Binary values are represented in hexadecimal. Converting Binary to Hexadecimal
  • 10. • Multiply each digit by its corresponding power of 16: • Examples: – Hex 1234 = (1  163) + (2  162) + (3  161) + (4  160) = Decimal 4,660 – Hex 3BA4 = (3  163) + (11 * 162) + (10  161) + (4  160) = Decimal 15,268 Converting Hexadecimal to Decimal Converting Hexadecimal to Binary• Each Hexadecimal digit can be replaced by its 4-bit binary number to form the binary equivalent.
  • 11. Binary Addition • Start with the least significant bit (rightmost bit) • Add each pair of bits • Include the carry in the addition, if present 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 + 0 0 0 0 1 0 1 1 1 (4) (7) (11) carry: 01234bit position: 567
  • 12. Hexadecimal Addition • Divide the sum of two digits by the number base (16). The quotient becomes the carry value, and the remainder is the sum digit. 36 28 28 6A 42 45 58 4B 78 6D 80 B5 11 21 / 16 = 1, remainder 5 Important skill: Programmers frequently add and subtract the addresses of variables and instructions.
  • 13. Binary Subtraction • Rules of Binary Subtraction 0 - 0 = 0 0 - 1 = 1, and borrow 1 from the next more significant bit 1 - 0 = 1 1 - 1 = 0 • For example, 00100101- 00010001=00010100 0 borrows 0 0 1 10 0 1 0 1 = 37(base 10) - 0 0 0 1 0 0 0 1 = 17(base 10) 0 0 0 1 0 1 0 0 = 20(base 10)
  • 14. When a borrow is required from the digit to the left, add 16 (decimal) to the current digit's value Hexadecimal Subtraction C675 A247 242E -1 - 16 + 5 = 21 C675 5DB9 (2's complement) 242E (same result) 1 + 1
  • 15. • There are three ways in which signed binary numbers may be expressed: – Signed magnitude, – One’s complement and – Two’s complement. • In an 8-bit word, signed magnitude representation places the absolute value of the number in the 7 bits to the right of the sign bit. • For example, in 8-bit signed magnitude, positive 3 is: 00000011 • Negative 3 is: 10000011 Signed Integer Representation
  • 16. One's Complement • The one's complement of an integer is obtained by complementing each bit; that is, replace each 0 by a 1 and each 1 by a O. In the following , we assume numbers are 16 bits. • Example : Find the one's complement of 5 = 0000000000000101. Solution: 5= OOOOOOOOOO0OO I 0 I One's complement of 5 = 1111111111111010 Note that if we add 5 and its one's complement, we get 1111111111111111.
  • 17. Two's Complement Representation • Start at the least significant digit, leaving all the 0s unchanged, look for the first occurrence of a non-zero digit. Example: Find the two's complement of the 5. Solution: 5=00000000000000101 Ones complement of 5 =1111111111111010 +1 two's complement of 5 = 1111111111111011
  • 18. Here is my basic idea of how the program should be structured in number system: • org 100h • mov al, 00000101b ; (hex: 5h) mov bl, 0ah • mov cl, 10o • Add al, bl ; 5 + 10 = 15 (0fh) ; 15 - 8 = 7 • sub al, cl • mov bl, al ; print result in binary: • mov cx, 8 • print: • mov ah, 2 ; print function. • mov dl, '0' • test bl, 10000000b ; test first bit. • jz zero • mov dl, '1' • zero: • int 21h • shl bl, 1 • loop print • mov dl, 'b' • int 21h • mov ah, 0 • int 16h • ret