SlideShare a Scribd company logo
CSC 222: Computer Organization 
& Assembly Language 
3 – Data Representation 
Instructor: Ms. Nausheen Majeed
Number System 
 Any number system using a range of digits that 
represents a specific number. The most common 
numbering systems are decimal, binary, octal, and 
hexadecimal. 
 Numbers are important to computers 
 represent information precisely 
 can be processed 
 For example: 
 to represent yes or no: use 0 for no and 1 for yes 
 to represent 4 seasons: 0 (autumn), 1 (winter), 2(spring) and 3 
(summer) 
2
Positional Number System 
 A computer can understand positional number system 
where there are only a few symbols called digits and 
these symbols represent different values depending on 
the position they occupy in the number. 
 A value of each digit in a number can be determined 
using 
 The digit 
 The position of the digit in the number 
 The base of the number system (where base is defined 
as the total number of digits available in the number 
system). 
3
Decimal Number System 
4
Binary Number System 
5
Hexadecimal Number System 
6
Conversion Between Number Systems 
 Converting Hexadecimal to Decimal 
 Multiply each digit of the hexadecimal number from right to left with its 
corresponding power of 16 or weighted value. 
 Convert the Hexadecimal number 82ADh to decimal number. 
7
Conversion Between Number Systems 
 Converting Binary to Decimal 
 Multiply each digit of the binary number from right to left with its 
corresponding power of 2 or weighted value. 
 Convert the Binary number 11101 to decimal number. 
8
Conversion Between Number Systems 
 Converting Decimal to Binary 
 Divide the decimal number by 2. 
 Take the remainder and record it on the side. 
 REPEAT UNTIL the decimal number cannot be divided into anymore. 
9
Conversion Between Number Systems 
 Converting Decimal to Hexadecimal 
 Divide the decimal number by 16. 
 Take the remainder and record it on the side. 
 REPEAT UNTIL the decimal number cannot be divided into anymore. 
10
Conversion Between Number Systems 
 Converting Hexadecimal to Binary 
 Given a hexadecimal number, simply convert each digit to it’s binary 
equivalent. Then, combine each 4 bit binary number and that is the resulting 
answer. 
 Converting Binary to Hexadecimal 
 Begin at the rightmost 4 bits. If there are not 4 bits, pad 0s to the left until 
you hit 4. Repeat the steps until all groups have been converted. 
11
Binary Arithmetic Operations 
 Addition 
 Like decimal numbers, two numbers can be added by 
adding each pair of digits together with carry propagation. 
12 
11001 
+ 10011 
101100 
647 
+ 537 
1184 
Binary Addition Decimal Addition
Binary Arithmetic Operations 
 Subtraction 
 Two numbers can be subtracted by subtracting each pair 
of digits together with borrowing, where needed. 
13 
11001 
- 10011 
00110 
627 
- 537 
090 
Binary Subtraction Decimal Subtraction
Hexadecimal Arithmetic Operations 
 Addition 
 Like decimal numbers, two numbers can be added by 
adding each pair of digits together with carry propagation. 
14 
5B39 
+ 7AF4 
D62D 
Hexadecimal Addition
HexaDecimal Arithmetic Operations 
 Subtraction 
 Two numbers can be subtracted by subtracting each pair 
of digits together with borrowing, where needed. 
15 
D26F 
- BA94 
17DB 
Hexadecimal Subtraction
MSB and LSB 
 In computing, the most significant bit (msb) is the 
bit position in a binary number having the greatest 
value. The msb is sometimes referred to as the left-most 
bit. 
 In computing, the least significant bit (lsb) is the bit 
position in a binary integer giving the units value, 
that is, determining whether the number is even or 
odd. The lsb is sometimes referred to as the right-most 
bit. 
16
Unsigned Integers 
 An unsigned integer is an integer at represent a 
magnitude, so it is never negative. 
 Unsigned integers are appropriate for representing 
quantities that can be never negative. 
17
Signed Integers 
 A signed integer can be positive or negative. 
 The most significant bit is reserved for the sign: 
 1 means negative and 0 means positive. 
 Example: 
00001010 = decimal 10 
10001010 = decimal -10 
18
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 0. 
19
2’s Complement 
 Negative integers are stored in computer using 2’s 
complement. 
 To get a two’s complement by first finding the one’s 
complement, and then by adding 1 to it. 
 Example 
11110011 (one's complement of 12) 
+ 00000001 (decimal 1) 
11110100 (two's complement of 12) 
20
Subtract as 2’s Complement Addition 
 Find the difference of 12 – 5 using complementation 
and addition. 
 00000101 (decimal 5) 
 11111011 (2’s Complement of 5) 
00001100 (decimal 12) 
+ 11111011 (decimal -5) 
00000111 (decimal 7) 
No Carry 
21
Example 
 Find the difference of 5ABCh – 21FCh using 
complementation and addition. 
 5ABCh = 0101 1010 1011 1100 
 21FCh = 0010 0001 1111 1100 
 1101 1110 0000 0100 (2’s Complement of 21FCh) 
0101 1010 1011 1100 (Binary 5ABCh) 
+ 1101 1110 0000 0100 (1’s Complement of 21FCh) 
10011 1000 1100 0000 
Discard 
Carry 
22
Decimal Interpretation 
 How to interpret the contents of a byte or word as a 
signed and unsigned decimal integer? 
 Unsigned decimal interpretation 
 Simply just do a binary to decimal conversion or first 
convert binary to hexadecimal and then convert 
hexadecimal to decimal. 
 Signed decimal interpretation 
 If msb is zero then number is positive and signed decimal 
is same as unsigned decimal. 
 If msb is one then number is negative, so call it -N. To find 
N, just take the 2’s complement and then convert to 
decimal. 
23
Example 
 Give unsigned and signed decimal interpretation 
FE0Ch. 
 Unsigned decimal interpretation 
 163 ∗ 15 + 162 ∗ 14 + 161 ∗ 0 + 160 ∗ 12 = 61440 + 
3584 + 0 + 12 = 65036 
 Signed decimal interpretation 
 FE0Ch = 1111 1110 0000 1100 (msb is 1, so number is 
negative). 
 To find N, get its 2’s complement 
0000 0001 1111 0011 (1’s complement of FE0Ch) 
+ 1 
N = 0000 0001 1111 0100 = 01F4h = 500 
24So, -N = 500
Decimal Interpretation 
 For 16 – bit word, following relationships holds 
between signed and unsigned decimal interpretation 
 From 0000h – 7FFFh, signed decimal = unsigned 
decimal 
 From 8000h – FFFFh, signed decimal = unsigned 
decimal – 65536. 
 Example: 
 Unsigned interpretation of FE0Ch is 65036. 
 Signed interpretation of FE0Ch = 65036 – 65536 = - 
500. 
25
Binary, Decimal, and Hexadecimal Equivalents. 
Binary Decimal Hexadecimal Binary Decimal Hexadecimal 
0000 0 0 1000 8 8 
0001 1 1 1001 9 9 
0010 2 2 1010 10 A 
0011 3 3 1011 11 B 
0100 4 4 1100 12 C 
0101 5 5 1101 13 D 
0110 6 6 1110 14 E 
0111 7 7 1111 15 F
Character Representation 
 All data, characters must be coded in binary to be 
processed by the computer. 
 ASCII: 
 American Standard Code for Information Interchange 
 Most popular character encoding scheme. 
 Uses 7 bit to code each character. 
 27 = 128 ASCII codes. 
 Single character Code = One Byte [7 bits: char code, 8th 
bit set to zero] 
 32 to 126 ASCII codes: printable 
 0 to 31 and 127 ASCII codes: Control characters 
27
28
How to Convert? 
 If a byte contains the ASCII code of an uppercase 
letter, what hex should be added to it to convert to 
lower case? 
 Solution: 20 h 
 Example: A (41h) a (61 h) 
 If a byte contains the ASCII code of a decimal digit, 
What hex should be subtracted from the byte to 
convert it to the numerical form of the characters? 
 Solution: 30 h 
 Example: 2 (32 h) 
29
Character Storage 
ASCII Representation of “123” and 123 
30 
' 1 ' ' 2 ' ' 3 ' 
00110001 00110010 00110011 
123 
01111011 
= 
= 
"1 2 3" 
1 2 3

More Related Content

What's hot

computer Architecture
computer Architecturecomputer Architecture
computer Architecture
umardanjumamaiwada
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
CS_GDRCST
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Set associative mapping
Set associative mappingSet associative mapping
Set associative mapping
Ashik Khan
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
Nallapati Anindra
 
Computer registers
Computer registersComputer registers
Computer registers
Jatin Grover
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
cs19club
 
File handling functions
File  handling    functionsFile  handling    functions
File handling functionsTech_MX
 
Number Systems
Number SystemsNumber Systems
Number Systems
Jubayer Alam Shoikat
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
Jordan Delacruz
 
Fetch decode-execute presentation
Fetch decode-execute presentationFetch decode-execute presentation
Fetch decode-execute presentationchantellemallia
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representationekul
 
BCD.
BCD.BCD.
Number+system (1)
Number+system (1)Number+system (1)
Number+system (1)
Bilal Maqbool ツ
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmsPiyush Rochwani
 
Assembly Language and microprocessor
Assembly Language and microprocessorAssembly Language and microprocessor
Assembly Language and microprocessor
Khaled Sany
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
fasihuddin90
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 

What's hot (20)

computer Architecture
computer Architecturecomputer Architecture
computer Architecture
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Set associative mapping
Set associative mappingSet associative mapping
Set associative mapping
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 
Computer registers
Computer registersComputer registers
Computer registers
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
 
File handling functions
File  handling    functionsFile  handling    functions
File handling functions
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Fetch decode-execute presentation
Fetch decode-execute presentationFetch decode-execute presentation
Fetch decode-execute presentation
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
BCD.
BCD.BCD.
BCD.
 
Number+system (1)
Number+system (1)Number+system (1)
Number+system (1)
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Assembly Language and microprocessor
Assembly Language and microprocessorAssembly Language and microprocessor
Assembly Language and microprocessor
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 

Viewers also liked

[1] Data Representation
[1] Data Representation[1] Data Representation
[1] Data Representation
Mr McAlpine
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
Hazel Anne Quirao
 
Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representationiarthur
 
How computers represent data
How computers represent dataHow computers represent data
How computers represent dataShaon Ahmed
 
Computer Data Representation
Computer Data RepresentationComputer Data Representation
Computer Data Representation
ritaester
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03
thearticlenow
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
Data representation
 Data representation Data representation
Data representation
Ashraf Miraz
 
Different charts, Different representation
Different charts, Different representationDifferent charts, Different representation
Different charts, Different representation
Tushar Saini
 
Basic Statistical Concepts & Decision-Making
Basic Statistical Concepts & Decision-MakingBasic Statistical Concepts & Decision-Making
Basic Statistical Concepts & Decision-MakingPenn State University
 
Statistics for Decision Making Week 1 Lecture
Statistics for Decision Making Week 1 LectureStatistics for Decision Making Week 1 Lecture
Statistics for Decision Making Week 1 Lecture
Brent Heard
 
Chap 2 network models
Chap 2 network modelsChap 2 network models
Chap 2 network models
Mukesh Tekwani
 
2.1 Part 1 - Frequency Distributions
2.1 Part 1 - Frequency Distributions2.1 Part 1 - Frequency Distributions
2.1 Part 1 - Frequency Distributionsleblance
 
Data Representation
Data RepresentationData Representation
Data Representation
Education Front
 
Networks classification
Networks classificationNetworks classification
Networks classification
Mukesh Chinta
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
Education Front
 

Viewers also liked (20)

[1] Data Representation
[1] Data Representation[1] Data Representation
[1] Data Representation
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representation
 
How computers represent data
How computers represent dataHow computers represent data
How computers represent data
 
Computer Data Representation
Computer Data RepresentationComputer Data Representation
Computer Data Representation
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Data representation
 Data representation Data representation
Data representation
 
Ppt on internet
Ppt on internetPpt on internet
Ppt on internet
 
Different charts, Different representation
Different charts, Different representationDifferent charts, Different representation
Different charts, Different representation
 
The internet
The internetThe internet
The internet
 
Internet
InternetInternet
Internet
 
Basic Statistical Concepts & Decision-Making
Basic Statistical Concepts & Decision-MakingBasic Statistical Concepts & Decision-Making
Basic Statistical Concepts & Decision-Making
 
Statistics for Decision Making Week 1 Lecture
Statistics for Decision Making Week 1 LectureStatistics for Decision Making Week 1 Lecture
Statistics for Decision Making Week 1 Lecture
 
Chap 2 network models
Chap 2 network modelsChap 2 network models
Chap 2 network models
 
2.1 Part 1 - Frequency Distributions
2.1 Part 1 - Frequency Distributions2.1 Part 1 - Frequency Distributions
2.1 Part 1 - Frequency Distributions
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Arpanet.53
Arpanet.53Arpanet.53
Arpanet.53
 
Networks classification
Networks classificationNetworks classification
Networks classification
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 

Similar to Data Representation

Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
AswiniT3
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
AswiniT3
 
chapter2.pptx electrical engineering for student
chapter2.pptx electrical engineering for studentchapter2.pptx electrical engineering for student
chapter2.pptx electrical engineering for student
MidhaksaBelay
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
Number system
Number systemNumber system
Number system
Darpan Chelani
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
shubhangisonawane6
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4
wajanga
 
IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015
Aron Kondoro
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
VandanaPagar1
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
sulekhasaxena2
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
Suganthi Vasanth Raj
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
IsfahanAhmed3
 
numbers_systems.pptx
numbers_systems.pptxnumbers_systems.pptx
numbers_systems.pptx
MohammedtajuddinTaju
 
numbers_systems (1).ppt
numbers_systems (1).pptnumbers_systems (1).ppt
numbers_systems (1).ppt
YashNaware2
 
Conversion between various numbers_systems
Conversion between various numbers_systemsConversion between various numbers_systems
Conversion between various numbers_systems
dradilkhan87
 
Number Systems
Number SystemsNumber Systems
Number Systems
Infinity Tech Solutions
 
Data representation
Data representationData representation
Data representation
Manish Kumar
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
ODAATUBE1
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
Ammar_n
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
AmrutaMehata
 

Similar to Data Representation (20)

Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 
chapter2.pptx electrical engineering for student
chapter2.pptx electrical engineering for studentchapter2.pptx electrical engineering for student
chapter2.pptx electrical engineering for student
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Number system
Number systemNumber system
Number system
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
IS 139 Lecture 4
IS 139 Lecture 4IS 139 Lecture 4
IS 139 Lecture 4
 
IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015IS 139 Lecture 4 - 2015
IS 139 Lecture 4 - 2015
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
 
numbers_systems.ppt
numbers_systems.pptnumbers_systems.ppt
numbers_systems.ppt
 
numbers_systems.pptx
numbers_systems.pptxnumbers_systems.pptx
numbers_systems.pptx
 
numbers_systems (1).ppt
numbers_systems (1).pptnumbers_systems (1).ppt
numbers_systems (1).ppt
 
Conversion between various numbers_systems
Conversion between various numbers_systemsConversion between various numbers_systems
Conversion between various numbers_systems
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Data representation
Data representationData representation
Data representation
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 

More from Education Front

Improving Pronunciation
Improving PronunciationImproving Pronunciation
Improving Pronunciation
Education Front
 
Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process ModelsEducation Front
 
2- Dimensional Arrays
2- Dimensional Arrays2- Dimensional Arrays
2- Dimensional Arrays
Education Front
 
Problem Sloving
Problem SlovingProblem Sloving
Problem Sloving
Education Front
 
Problem Solving - 1
Problem Solving - 1Problem Solving - 1
Problem Solving - 1
Education Front
 
Introduction To Stack
Introduction To StackIntroduction To Stack
Introduction To Stack
Education Front
 
Process Models
Process ModelsProcess Models
Process Models
Education Front
 
Process Models
Process ModelsProcess Models
Process Models
Education Front
 
Introduction to Algorithm
Introduction to AlgorithmIntroduction to Algorithm
Introduction to Algorithm
Education Front
 
Revised Process of Communication
Revised Process of CommunicationRevised Process of Communication
Revised Process of Communication
Education Front
 
Importance of Language in Communication
Importance of Language in CommunicationImportance of Language in Communication
Importance of Language in Communication
Education Front
 
Lecture1 (SE Introduction)
Lecture1 (SE Introduction)Lecture1 (SE Introduction)
Lecture1 (SE Introduction)
Education Front
 
Lecture 2 (Software Processes)
Lecture 2 (Software Processes)Lecture 2 (Software Processes)
Lecture 2 (Software Processes)
Education Front
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureEducation Front
 
Facing Today’s Communication Challenges
Facing Today’s Communication ChallengesFacing Today’s Communication Challenges
Facing Today’s Communication Challenges
Education Front
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
Education Front
 
Register & Memory
Register & MemoryRegister & Memory
Register & Memory
Education Front
 
Computer Evolution
Computer EvolutionComputer Evolution
Computer Evolution
Education Front
 
Introduction To EMU
Introduction To EMUIntroduction To EMU
Introduction To EMU
Education Front
 
Lecture 2: Facing Today’s Communication Challenges.
Lecture 2: Facing Today’s Communication Challenges.Lecture 2: Facing Today’s Communication Challenges.
Lecture 2: Facing Today’s Communication Challenges.
Education Front
 

More from Education Front (20)

Improving Pronunciation
Improving PronunciationImproving Pronunciation
Improving Pronunciation
 
Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process Models
 
2- Dimensional Arrays
2- Dimensional Arrays2- Dimensional Arrays
2- Dimensional Arrays
 
Problem Sloving
Problem SlovingProblem Sloving
Problem Sloving
 
Problem Solving - 1
Problem Solving - 1Problem Solving - 1
Problem Solving - 1
 
Introduction To Stack
Introduction To StackIntroduction To Stack
Introduction To Stack
 
Process Models
Process ModelsProcess Models
Process Models
 
Process Models
Process ModelsProcess Models
Process Models
 
Introduction to Algorithm
Introduction to AlgorithmIntroduction to Algorithm
Introduction to Algorithm
 
Revised Process of Communication
Revised Process of CommunicationRevised Process of Communication
Revised Process of Communication
 
Importance of Language in Communication
Importance of Language in CommunicationImportance of Language in Communication
Importance of Language in Communication
 
Lecture1 (SE Introduction)
Lecture1 (SE Introduction)Lecture1 (SE Introduction)
Lecture1 (SE Introduction)
 
Lecture 2 (Software Processes)
Lecture 2 (Software Processes)Lecture 2 (Software Processes)
Lecture 2 (Software Processes)
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Facing Today’s Communication Challenges
Facing Today’s Communication ChallengesFacing Today’s Communication Challenges
Facing Today’s Communication Challenges
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
 
Register & Memory
Register & MemoryRegister & Memory
Register & Memory
 
Computer Evolution
Computer EvolutionComputer Evolution
Computer Evolution
 
Introduction To EMU
Introduction To EMUIntroduction To EMU
Introduction To EMU
 
Lecture 2: Facing Today’s Communication Challenges.
Lecture 2: Facing Today’s Communication Challenges.Lecture 2: Facing Today’s Communication Challenges.
Lecture 2: Facing Today’s Communication Challenges.
 

Recently uploaded

PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 

Recently uploaded (20)

PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 

Data Representation

  • 1. CSC 222: Computer Organization & Assembly Language 3 – Data Representation Instructor: Ms. Nausheen Majeed
  • 2. Number System  Any number system using a range of digits that represents a specific number. The most common numbering systems are decimal, binary, octal, and hexadecimal.  Numbers are important to computers  represent information precisely  can be processed  For example:  to represent yes or no: use 0 for no and 1 for yes  to represent 4 seasons: 0 (autumn), 1 (winter), 2(spring) and 3 (summer) 2
  • 3. Positional Number System  A computer can understand positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number.  A value of each digit in a number can be determined using  The digit  The position of the digit in the number  The base of the number system (where base is defined as the total number of digits available in the number system). 3
  • 7. Conversion Between Number Systems  Converting Hexadecimal to Decimal  Multiply each digit of the hexadecimal number from right to left with its corresponding power of 16 or weighted value.  Convert the Hexadecimal number 82ADh to decimal number. 7
  • 8. Conversion Between Number Systems  Converting Binary to Decimal  Multiply each digit of the binary number from right to left with its corresponding power of 2 or weighted value.  Convert the Binary number 11101 to decimal number. 8
  • 9. Conversion Between Number Systems  Converting Decimal to Binary  Divide the decimal number by 2.  Take the remainder and record it on the side.  REPEAT UNTIL the decimal number cannot be divided into anymore. 9
  • 10. Conversion Between Number Systems  Converting Decimal to Hexadecimal  Divide the decimal number by 16.  Take the remainder and record it on the side.  REPEAT UNTIL the decimal number cannot be divided into anymore. 10
  • 11. Conversion Between Number Systems  Converting Hexadecimal to Binary  Given a hexadecimal number, simply convert each digit to it’s binary equivalent. Then, combine each 4 bit binary number and that is the resulting answer.  Converting Binary to Hexadecimal  Begin at the rightmost 4 bits. If there are not 4 bits, pad 0s to the left until you hit 4. Repeat the steps until all groups have been converted. 11
  • 12. Binary Arithmetic Operations  Addition  Like decimal numbers, two numbers can be added by adding each pair of digits together with carry propagation. 12 11001 + 10011 101100 647 + 537 1184 Binary Addition Decimal Addition
  • 13. Binary Arithmetic Operations  Subtraction  Two numbers can be subtracted by subtracting each pair of digits together with borrowing, where needed. 13 11001 - 10011 00110 627 - 537 090 Binary Subtraction Decimal Subtraction
  • 14. Hexadecimal Arithmetic Operations  Addition  Like decimal numbers, two numbers can be added by adding each pair of digits together with carry propagation. 14 5B39 + 7AF4 D62D Hexadecimal Addition
  • 15. HexaDecimal Arithmetic Operations  Subtraction  Two numbers can be subtracted by subtracting each pair of digits together with borrowing, where needed. 15 D26F - BA94 17DB Hexadecimal Subtraction
  • 16. MSB and LSB  In computing, the most significant bit (msb) is the bit position in a binary number having the greatest value. The msb is sometimes referred to as the left-most bit.  In computing, the least significant bit (lsb) is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The lsb is sometimes referred to as the right-most bit. 16
  • 17. Unsigned Integers  An unsigned integer is an integer at represent a magnitude, so it is never negative.  Unsigned integers are appropriate for representing quantities that can be never negative. 17
  • 18. Signed Integers  A signed integer can be positive or negative.  The most significant bit is reserved for the sign:  1 means negative and 0 means positive.  Example: 00001010 = decimal 10 10001010 = decimal -10 18
  • 19. 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 0. 19
  • 20. 2’s Complement  Negative integers are stored in computer using 2’s complement.  To get a two’s complement by first finding the one’s complement, and then by adding 1 to it.  Example 11110011 (one's complement of 12) + 00000001 (decimal 1) 11110100 (two's complement of 12) 20
  • 21. Subtract as 2’s Complement Addition  Find the difference of 12 – 5 using complementation and addition.  00000101 (decimal 5)  11111011 (2’s Complement of 5) 00001100 (decimal 12) + 11111011 (decimal -5) 00000111 (decimal 7) No Carry 21
  • 22. Example  Find the difference of 5ABCh – 21FCh using complementation and addition.  5ABCh = 0101 1010 1011 1100  21FCh = 0010 0001 1111 1100  1101 1110 0000 0100 (2’s Complement of 21FCh) 0101 1010 1011 1100 (Binary 5ABCh) + 1101 1110 0000 0100 (1’s Complement of 21FCh) 10011 1000 1100 0000 Discard Carry 22
  • 23. Decimal Interpretation  How to interpret the contents of a byte or word as a signed and unsigned decimal integer?  Unsigned decimal interpretation  Simply just do a binary to decimal conversion or first convert binary to hexadecimal and then convert hexadecimal to decimal.  Signed decimal interpretation  If msb is zero then number is positive and signed decimal is same as unsigned decimal.  If msb is one then number is negative, so call it -N. To find N, just take the 2’s complement and then convert to decimal. 23
  • 24. Example  Give unsigned and signed decimal interpretation FE0Ch.  Unsigned decimal interpretation  163 ∗ 15 + 162 ∗ 14 + 161 ∗ 0 + 160 ∗ 12 = 61440 + 3584 + 0 + 12 = 65036  Signed decimal interpretation  FE0Ch = 1111 1110 0000 1100 (msb is 1, so number is negative).  To find N, get its 2’s complement 0000 0001 1111 0011 (1’s complement of FE0Ch) + 1 N = 0000 0001 1111 0100 = 01F4h = 500 24So, -N = 500
  • 25. Decimal Interpretation  For 16 – bit word, following relationships holds between signed and unsigned decimal interpretation  From 0000h – 7FFFh, signed decimal = unsigned decimal  From 8000h – FFFFh, signed decimal = unsigned decimal – 65536.  Example:  Unsigned interpretation of FE0Ch is 65036.  Signed interpretation of FE0Ch = 65036 – 65536 = - 500. 25
  • 26. Binary, Decimal, and Hexadecimal Equivalents. Binary Decimal Hexadecimal Binary Decimal Hexadecimal 0000 0 0 1000 8 8 0001 1 1 1001 9 9 0010 2 2 1010 10 A 0011 3 3 1011 11 B 0100 4 4 1100 12 C 0101 5 5 1101 13 D 0110 6 6 1110 14 E 0111 7 7 1111 15 F
  • 27. Character Representation  All data, characters must be coded in binary to be processed by the computer.  ASCII:  American Standard Code for Information Interchange  Most popular character encoding scheme.  Uses 7 bit to code each character.  27 = 128 ASCII codes.  Single character Code = One Byte [7 bits: char code, 8th bit set to zero]  32 to 126 ASCII codes: printable  0 to 31 and 127 ASCII codes: Control characters 27
  • 28. 28
  • 29. How to Convert?  If a byte contains the ASCII code of an uppercase letter, what hex should be added to it to convert to lower case?  Solution: 20 h  Example: A (41h) a (61 h)  If a byte contains the ASCII code of a decimal digit, What hex should be subtracted from the byte to convert it to the numerical form of the characters?  Solution: 30 h  Example: 2 (32 h) 29
  • 30. Character Storage ASCII Representation of “123” and 123 30 ' 1 ' ' 2 ' ' 3 ' 00110001 00110010 00110011 123 01111011 = = "1 2 3" 1 2 3