SlideShare a Scribd company logo
1 of 34
Download to read offline
Connecting with Computer Science 2
Objectives
• Learn why numbering systems are important to
understand
• Refresh your knowledge of powers of numbers
• Learn how numbering systems are used to count
• Understand the significance of positional value in a
numbering system
• Learn the differences and similarities between
numbering system bases
Connecting with Computer Science 3
Objectives (continued)
• Learn how to convert numbers between bases
• Learn how to do binary and hexadecimal math
• Learn how data is represented as binary in the
computer
• Learn how images and sounds are stored in the
computer
Connecting with Computer Science 4
Why You Need to Know About...
Numbering Systems
• Computers store programs and data in binary code
• Understanding of binary code is key to machine
• Binary number system is point of departure
• Hexadecimal number system
– Provides convenient representation
– Written into error messages
Connecting with Computer Science 5
Powers of Numbers - A Refresher
• Raising a number to a positive power (exponent)
– Self-multiply the number by the specified power
– Example: 23 = 2 * 2 * 2 = 8 (asterisk = multiplication)
– Special cases: 0 and 1 as powers
• Any number raised to 0 = 1; e.g, 10,5550 = 1.
• Any number raised to 1 = itself; e.g., 10,5551 = 10,555
Connecting with Computer Science 6
Powers of Numbers -A Refresher
(continued)
• Raising a number to a negative power
– Follow same steps for positive power
– Divide result into 1; e.g., 2-3 = 1/ (23) = .125
Connecting with Computer Science 7
Counting Things
• Numbers are used to count things
– Base 10 (decimal) most familiar
• The computer uses base 2, called binary
– Base 2 has two unique digits: 0 and 1
Connecting with Computer Science 8
Counting Things (continued)
• Hexadecimal system used to represent binary digits
– Base 16 has sixteen unique digits: 0 – 9, A - F
• Counting for all number systems similar
– Count digits defined in number system until exhausted
– Place zero in ones column. Carry one to the left
Connecting with Computer Science 9
Positional Value
• Weight assigned digit based on position in number
– Determine positional value of each digit by raising 10
to position within number
– Determine digit’s contribution to overall number by
multiplying digit by positional value
– Consider 5 in 3456.123 (radix = 10 = decimal point)
• Positional value = 101
• Overall contribution = 5 x 101 = 50
Connecting with Computer Science 10
Connecting with Computer Science 11
Positional Value (continued)
• Number: sum of products of each digit and positional
value
– Example: 3456.123 = 3 x 103 + 4 x 102 + 5 x 101 + 6 x
100 + 1 x 10-1 + 2 x 10-2 + 3 x 10-3
• Numbers in all bases can be defined by position
– Base 2: Multiply each digit by 2 digit position
– Base 16: Multiply each digit by 16 digit position
– Base b: Multiply each digit by b digit position
Connecting with Computer Science 12
Connecting with Computer Science 13
How Many Things Does
A Number Represent
• Number = sum of each digit x positional value
– Translate number of things to accord with base 10
– e.g.: 10012 is equivalent to nine things = (1 * 20) + (0 *
21) + (0 * 22) + (1 * 23)
• General procedure for evaluating numbers (any base)
1. Calculate the value for each position of the number
by raising the base value to the power of the position
2. Multiply positional value by digit in that position
3. Add each of the calculated values together
Connecting with Computer Science 14
Converting Numbers
Between Bases
• Any quantity can be represented by some number
in any base
• Counting process similar for all bases
1. Count until highest digit for base reached
2. Add 1 to next higher position to left
3. Return 0 to current position
• Conversion is a map from one base to another
– Identities can be easily calculated
– Identities may also be obtained by table look-up
Connecting with Computer Science 15
Connecting with Computer Science 16
Converting To Base 10
• Three methods:
1. Table look-up (more extensive than Table 4-1)
2. Calculator
3. Algorithm for evaluating number in any base
• Example: consider 169AE in base 16
– Identify base: 16
– Map positions to digits: 4 3 2 1 0
– Raise, multiply and add: 169AE = (1 x 164) + (6 x
163) + (9 x 162) + (10 x 161) + (14 x 160) = 92,590
Connecting with Computer Science 17
Converting From Base 10
• Three methods:
1. Table look-up (more extensive than Table 4-1)
2. Calculator
Connecting with Computer Science 18
Converting From Base 10
(continued)
3. Algorithm for converting from base 10
1. Divide the decimal number by the number of the target
base (for example, 2 or 16)
2. Write down the remainder
3. Divide the quotient of the prior division by the base
again
4. Write the remainder to the left of the last remainder
written
5. Repeat Steps 3 and 4 until the whole number result is 0
Connecting with Computer Science 19
Converting From Base 10
(continued)
• Practice conversion algorithm: find hexadecimal
equivalent of decimal 45
– Divide 45 by 16 (base)
– Write down remainder D
– Divide 2 by 16
– Write down remainder 2 to the left of D (2D)
– Stop since reduced quotient = 0
– Check: 2D = (2 x 161) + (13 x 160) = 32 + 13 = 45
Connecting with Computer Science 20
Binary And Hexadecimal Math
• Procedure for adding numbers similar in all bases
– Difference lies in carry process
– Value of carry = value of base
– Example: 1011
+1101
11000
– Carry value for above = 102 = (1 x 101 + 0 x 100 ) = 210
• Procedure for subtraction, multiplication, and
division also similar
Connecting with Computer Science 21
Connecting with Computer Science 22
Data Representation In Binary
• Binary values map to two-state transistors
• Bit: fundamental logical/physical unit (1/0 = on/off)
• Byte: grouping of eight bits (nibble = ½ byte)
• Word: collection of bytes (4 bytes is typical)
• Hexadecimal used as binary shorthand
– Relate each hexadecimal digit to 4-bit binary pattern
– Example: 1111 1010 1100 1110 =
F A C E (see Table 4-1)
Connecting with Computer Science 23
Representing Whole Numbers
• Whole numbers stored in fixed number of bits
– 200410 stored as 16-bit integer 0000011111010100
• Signed numbers stored with two’s complement
– Left most bit reserved for sign (1 = neg and 0 = pos)
– If positive, store with leading zeroes to fit field
– If negative, perform two’s complement
• Reverse bit pattern
• Add 1 to number using binary addition
Connecting with Computer Science 24
Connecting with Computer Science 25
Representing Fractional Numbers
• Computers store fractional numbers (neg and pos)
• Storage technique based on floating-point notation
– Example of floating point number: 1.345 E+5
– 1.345 = mantissa, E = exponent, + 5 moves decimal
• IEEE-754 specification uses binary mantissas and
exponents
• Implementation details part of advanced study
Connecting with Computer Science 26
Representing Characters
• Computers store characters according to standards
• ASCII
– Represents characters with 7-bit pattern
– Provides for upper and lowercase English letters,
numeric characters, punctuation, special characters
– Accommodates 128 (27) different characters
• Globalization places upward pressure
– Extended ASCII: allows 8-bit patterns (256 total)
– Unicode: defined for 16 bit patterns (34,168 total)
Connecting with Computer Science 27
Representing Images
• Screen image made up of small dots of colored light
– Dot called “pixel” (picture element), smallest unit
– Resolution: # pixels in each row and column
– Each pixel is stored in the computer as a binary pattern
• RGB encoding
– Red, blue, and green assigned to eight of 24 bits
– White represented with 1s, black with 0s
– Color is the amount of red, green, and blue specified in
each of the 8-bit sections
Connecting with Computer Science 28
Representing Images (continued)
• Images, such as photos, stored with pixel-based
technologies
• Large image files can be compressed (JPG, GIF
formats)
• Moving images can also be compressed (MPEG,
MOV, WMV)
Connecting with Computer Science 29
Representing Sounds
• Sound represented as waveform with
– Amplitude (volume) and
– Frequency (pitch)
• Computer samples sounds at fixed intervals
– Samples given a binary value according to amplitude
– # bits in each sample determines amplitude range
– For CD-quality audio
• Sound must be sampled over 44,000 times a second
• Samples must allow > 65,000 different amplitudes
Connecting with Computer Science 30
Connecting with Computer Science 31
One Last Thought
• Binary code is the language of the machine
• Knowledge of base 2 and base 16 prerequisite to
knowledge of machine language
• Computer scientists are more effective with binary
and hexadecimal concepts
Connecting with Computer Science 32
Summary
• Knowledge of alternative number systems essential
• Machine language based on binary system
• Hexadecimal used to represent binary numbers
• Power rule for numbers defines self-multiplication
• Any number can be represented in any base
Connecting with Computer Science 33
Summary (continued)
• Positional value: weight based on digit position
• Counting processes similar for all bases
• Conversion between bases is one-to-one mapping
• Arithmetic defined for all bases
• Data representation: bits, nibbles, bytes, words
Connecting with Computer Science 34
Summary (continued)
• Two’s complement: technique for storing signed
numbers
• Floating point notation: system used to represent
fractions and irrationals
• ASCII and Unicode: character set standards
• Image representation: based on binary pixel
• Sound representation: based on amplitude samples

More Related Content

Similar to Numbering system data representation

digital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptxdigital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptx
abelllll
 

Similar to Numbering system data representation (20)

12117188.ppt
12117188.ppt12117188.ppt
12117188.ppt
 
digital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptxdigital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptx
 
12117188.ppt
12117188.ppt12117188.ppt
12117188.ppt
 
NUMBER SYSTEM.pptx
NUMBER SYSTEM.pptxNUMBER SYSTEM.pptx
NUMBER SYSTEM.pptx
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
DLD-unit-1(2022).pdf
DLD-unit-1(2022).pdfDLD-unit-1(2022).pdf
DLD-unit-1(2022).pdf
 
cyber_systems.pdf
cyber_systems.pdfcyber_systems.pdf
cyber_systems.pdf
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Number system
Number systemNumber system
Number system
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Number system
Number system  Number system
Number system
 
Number system
Number systemNumber system
Number system
 
NUMBER SYSTEM.pptx
NUMBER  SYSTEM.pptxNUMBER  SYSTEM.pptx
NUMBER SYSTEM.pptx
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 

More from satonaka3

chapter14 - Emerging Technologies.pdf
chapter14 - Emerging Technologies.pdfchapter14 - Emerging Technologies.pdf
chapter14 - Emerging Technologies.pdf
satonaka3
 
chapter13 - Computing Security Ethics.pdf
chapter13 - Computing Security Ethics.pdfchapter13 - Computing Security Ethics.pdf
chapter13 - Computing Security Ethics.pdf
satonaka3
 
chapter12 - Software engineering.pdf
chapter12 - Software engineering.pdfchapter12 - Software engineering.pdf
chapter12 - Software engineering.pdf
satonaka3
 
chapter10 - File structures.pdf
chapter10 - File structures.pdfchapter10 - File structures.pdf
chapter10 - File structures.pdf
satonaka3
 
chapter09 -Programming Data Structures.pdf
chapter09 -Programming Data Structures.pdfchapter09 -Programming Data Structures.pdf
chapter09 -Programming Data Structures.pdf
satonaka3
 
chapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdfchapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdf
satonaka3
 
chapter07 - The Internet.pdf
chapter07 - The Internet.pdfchapter07 - The Internet.pdf
chapter07 - The Internet.pdf
satonaka3
 
chapter06 - Networks.pdf
chapter06 - Networks.pdfchapter06 - Networks.pdf
chapter06 - Networks.pdf
satonaka3
 
chapter05 - Operating System.pdf
chapter05 - Operating System.pdfchapter05 - Operating System.pdf
chapter05 - Operating System.pdf
satonaka3
 

More from satonaka3 (10)

chapter14 - Emerging Technologies.pdf
chapter14 - Emerging Technologies.pdfchapter14 - Emerging Technologies.pdf
chapter14 - Emerging Technologies.pdf
 
chapter13 - Computing Security Ethics.pdf
chapter13 - Computing Security Ethics.pdfchapter13 - Computing Security Ethics.pdf
chapter13 - Computing Security Ethics.pdf
 
chapter12 - Software engineering.pdf
chapter12 - Software engineering.pdfchapter12 - Software engineering.pdf
chapter12 - Software engineering.pdf
 
chapter11 - Programming.pdf
chapter11 - Programming.pdfchapter11 - Programming.pdf
chapter11 - Programming.pdf
 
chapter10 - File structures.pdf
chapter10 - File structures.pdfchapter10 - File structures.pdf
chapter10 - File structures.pdf
 
chapter09 -Programming Data Structures.pdf
chapter09 -Programming Data Structures.pdfchapter09 -Programming Data Structures.pdf
chapter09 -Programming Data Structures.pdf
 
chapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdfchapter08 - Database fundamentals.pdf
chapter08 - Database fundamentals.pdf
 
chapter07 - The Internet.pdf
chapter07 - The Internet.pdfchapter07 - The Internet.pdf
chapter07 - The Internet.pdf
 
chapter06 - Networks.pdf
chapter06 - Networks.pdfchapter06 - Networks.pdf
chapter06 - Networks.pdf
 
chapter05 - Operating System.pdf
chapter05 - Operating System.pdfchapter05 - Operating System.pdf
chapter05 - Operating System.pdf
 

Recently uploaded

Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
Nitya salvi
 
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
delhimunirka15
 
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptxEngineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
DanielRemache4
 
Van Gogh Powerpoint for art lesson today
Van Gogh Powerpoint for art lesson todayVan Gogh Powerpoint for art lesson today
Van Gogh Powerpoint for art lesson today
lucygibson17
 
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
delhimunirka15
 
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts ServiceCall Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
ritikaroy0888
 
Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..
mvxpw22gfc
 
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) DelhiWhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
delhimunirka15
 
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
Miss Beniwal
 

Recently uploaded (20)

Theoretical Framework- Explanation with Flow Chart.docx
Theoretical Framework- Explanation with Flow Chart.docxTheoretical Framework- Explanation with Flow Chart.docx
Theoretical Framework- Explanation with Flow Chart.docx
 
Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
Call Girls In Sindhudurg Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service E...
 
Call Girls Mehsana - 📞 8617370543 Our call girls are sure to provide you with...
Call Girls Mehsana - 📞 8617370543 Our call girls are sure to provide you with...Call Girls Mehsana - 📞 8617370543 Our call girls are sure to provide you with...
Call Girls Mehsana - 📞 8617370543 Our call girls are sure to provide you with...
 
Orai call girls 📞 8617370543At Low Cost Cash Payment Booking
Orai call girls 📞 8617370543At Low Cost Cash Payment BookingOrai call girls 📞 8617370543At Low Cost Cash Payment Booking
Orai call girls 📞 8617370543At Low Cost Cash Payment Booking
 
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
Azad Nagar Call Girls ,☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genuin...
 
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptxEngineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
 
Navsari Call Girl 📞 8617370543 Low Price Genuine Service
Navsari Call Girl 📞 8617370543 Low Price Genuine ServiceNavsari Call Girl 📞 8617370543 Low Price Genuine Service
Navsari Call Girl 📞 8617370543 Low Price Genuine Service
 
Storyboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to SingStoryboard short: Ferrarius Tries to Sing
Storyboard short: Ferrarius Tries to Sing
 
Van Gogh Powerpoint for art lesson today
Van Gogh Powerpoint for art lesson todayVan Gogh Powerpoint for art lesson today
Van Gogh Powerpoint for art lesson today
 
Call Girls Veraval Just Call 8617370543Top Class Call Girl Service Available
Call Girls Veraval Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Veraval Just Call 8617370543Top Class Call Girl Service Available
Call Girls Veraval Just Call 8617370543Top Class Call Girl Service Available
 
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
Nehru Nagar, Call Girls ☎️ ((#9711106444)), 💘 Full enjoy Low rate girl💘 Genui...
 
Sonbhadra Escorts 📞 8617370543 | Sonbhadra Call Girls
Sonbhadra  Escorts 📞 8617370543 | Sonbhadra Call GirlsSonbhadra  Escorts 📞 8617370543 | Sonbhadra Call Girls
Sonbhadra Escorts 📞 8617370543 | Sonbhadra Call Girls
 
Russian Call Girls In Bhubaneswar 📱 Odisha 9777949614 Indore
Russian Call Girls In Bhubaneswar 📱 Odisha 9777949614 IndoreRussian Call Girls In Bhubaneswar 📱 Odisha 9777949614 Indore
Russian Call Girls In Bhubaneswar 📱 Odisha 9777949614 Indore
 
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts ServiceCall Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
Call Girls In Goa, North Goa 👌9971646499👌Cash On delivery Goa Escorts Service
 
Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..Museum of fine arts Lauren Simpson…………..
Museum of fine arts Lauren Simpson…………..
 
Sui Generis Magazine volume one Kristen Murillo.pdf
Sui Generis Magazine volume one Kristen Murillo.pdfSui Generis Magazine volume one Kristen Murillo.pdf
Sui Generis Magazine volume one Kristen Murillo.pdf
 
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) DelhiWhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
WhatsApp-(# 9711106444 #)Call Girl in Noida Sector 80 Noida (Escorts) Delhi
 
Digital C-Type Printing: Revolutionizing The Future Of Photographic Prints
Digital C-Type Printing: Revolutionizing The Future Of Photographic PrintsDigital C-Type Printing: Revolutionizing The Future Of Photographic Prints
Digital C-Type Printing: Revolutionizing The Future Of Photographic Prints
 
Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305Completed Event Presentation for Huma 1305
Completed Event Presentation for Huma 1305
 
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
Kathmandu Escort❤ @Daminy@💞 50+ Call Girl PRofile in @Kathmandu New Housewife...
 

Numbering system data representation

  • 1.
  • 2. Connecting with Computer Science 2 Objectives • Learn why numbering systems are important to understand • Refresh your knowledge of powers of numbers • Learn how numbering systems are used to count • Understand the significance of positional value in a numbering system • Learn the differences and similarities between numbering system bases
  • 3. Connecting with Computer Science 3 Objectives (continued) • Learn how to convert numbers between bases • Learn how to do binary and hexadecimal math • Learn how data is represented as binary in the computer • Learn how images and sounds are stored in the computer
  • 4. Connecting with Computer Science 4 Why You Need to Know About... Numbering Systems • Computers store programs and data in binary code • Understanding of binary code is key to machine • Binary number system is point of departure • Hexadecimal number system – Provides convenient representation – Written into error messages
  • 5. Connecting with Computer Science 5 Powers of Numbers - A Refresher • Raising a number to a positive power (exponent) – Self-multiply the number by the specified power – Example: 23 = 2 * 2 * 2 = 8 (asterisk = multiplication) – Special cases: 0 and 1 as powers • Any number raised to 0 = 1; e.g, 10,5550 = 1. • Any number raised to 1 = itself; e.g., 10,5551 = 10,555
  • 6. Connecting with Computer Science 6 Powers of Numbers -A Refresher (continued) • Raising a number to a negative power – Follow same steps for positive power – Divide result into 1; e.g., 2-3 = 1/ (23) = .125
  • 7. Connecting with Computer Science 7 Counting Things • Numbers are used to count things – Base 10 (decimal) most familiar • The computer uses base 2, called binary – Base 2 has two unique digits: 0 and 1
  • 8. Connecting with Computer Science 8 Counting Things (continued) • Hexadecimal system used to represent binary digits – Base 16 has sixteen unique digits: 0 – 9, A - F • Counting for all number systems similar – Count digits defined in number system until exhausted – Place zero in ones column. Carry one to the left
  • 9. Connecting with Computer Science 9 Positional Value • Weight assigned digit based on position in number – Determine positional value of each digit by raising 10 to position within number – Determine digit’s contribution to overall number by multiplying digit by positional value – Consider 5 in 3456.123 (radix = 10 = decimal point) • Positional value = 101 • Overall contribution = 5 x 101 = 50
  • 11. Connecting with Computer Science 11 Positional Value (continued) • Number: sum of products of each digit and positional value – Example: 3456.123 = 3 x 103 + 4 x 102 + 5 x 101 + 6 x 100 + 1 x 10-1 + 2 x 10-2 + 3 x 10-3 • Numbers in all bases can be defined by position – Base 2: Multiply each digit by 2 digit position – Base 16: Multiply each digit by 16 digit position – Base b: Multiply each digit by b digit position
  • 13. Connecting with Computer Science 13 How Many Things Does A Number Represent • Number = sum of each digit x positional value – Translate number of things to accord with base 10 – e.g.: 10012 is equivalent to nine things = (1 * 20) + (0 * 21) + (0 * 22) + (1 * 23) • General procedure for evaluating numbers (any base) 1. Calculate the value for each position of the number by raising the base value to the power of the position 2. Multiply positional value by digit in that position 3. Add each of the calculated values together
  • 14. Connecting with Computer Science 14 Converting Numbers Between Bases • Any quantity can be represented by some number in any base • Counting process similar for all bases 1. Count until highest digit for base reached 2. Add 1 to next higher position to left 3. Return 0 to current position • Conversion is a map from one base to another – Identities can be easily calculated – Identities may also be obtained by table look-up
  • 16. Connecting with Computer Science 16 Converting To Base 10 • Three methods: 1. Table look-up (more extensive than Table 4-1) 2. Calculator 3. Algorithm for evaluating number in any base • Example: consider 169AE in base 16 – Identify base: 16 – Map positions to digits: 4 3 2 1 0 – Raise, multiply and add: 169AE = (1 x 164) + (6 x 163) + (9 x 162) + (10 x 161) + (14 x 160) = 92,590
  • 17. Connecting with Computer Science 17 Converting From Base 10 • Three methods: 1. Table look-up (more extensive than Table 4-1) 2. Calculator
  • 18. Connecting with Computer Science 18 Converting From Base 10 (continued) 3. Algorithm for converting from base 10 1. Divide the decimal number by the number of the target base (for example, 2 or 16) 2. Write down the remainder 3. Divide the quotient of the prior division by the base again 4. Write the remainder to the left of the last remainder written 5. Repeat Steps 3 and 4 until the whole number result is 0
  • 19. Connecting with Computer Science 19 Converting From Base 10 (continued) • Practice conversion algorithm: find hexadecimal equivalent of decimal 45 – Divide 45 by 16 (base) – Write down remainder D – Divide 2 by 16 – Write down remainder 2 to the left of D (2D) – Stop since reduced quotient = 0 – Check: 2D = (2 x 161) + (13 x 160) = 32 + 13 = 45
  • 20. Connecting with Computer Science 20 Binary And Hexadecimal Math • Procedure for adding numbers similar in all bases – Difference lies in carry process – Value of carry = value of base – Example: 1011 +1101 11000 – Carry value for above = 102 = (1 x 101 + 0 x 100 ) = 210 • Procedure for subtraction, multiplication, and division also similar
  • 22. Connecting with Computer Science 22 Data Representation In Binary • Binary values map to two-state transistors • Bit: fundamental logical/physical unit (1/0 = on/off) • Byte: grouping of eight bits (nibble = ½ byte) • Word: collection of bytes (4 bytes is typical) • Hexadecimal used as binary shorthand – Relate each hexadecimal digit to 4-bit binary pattern – Example: 1111 1010 1100 1110 = F A C E (see Table 4-1)
  • 23. Connecting with Computer Science 23 Representing Whole Numbers • Whole numbers stored in fixed number of bits – 200410 stored as 16-bit integer 0000011111010100 • Signed numbers stored with two’s complement – Left most bit reserved for sign (1 = neg and 0 = pos) – If positive, store with leading zeroes to fit field – If negative, perform two’s complement • Reverse bit pattern • Add 1 to number using binary addition
  • 25. Connecting with Computer Science 25 Representing Fractional Numbers • Computers store fractional numbers (neg and pos) • Storage technique based on floating-point notation – Example of floating point number: 1.345 E+5 – 1.345 = mantissa, E = exponent, + 5 moves decimal • IEEE-754 specification uses binary mantissas and exponents • Implementation details part of advanced study
  • 26. Connecting with Computer Science 26 Representing Characters • Computers store characters according to standards • ASCII – Represents characters with 7-bit pattern – Provides for upper and lowercase English letters, numeric characters, punctuation, special characters – Accommodates 128 (27) different characters • Globalization places upward pressure – Extended ASCII: allows 8-bit patterns (256 total) – Unicode: defined for 16 bit patterns (34,168 total)
  • 27. Connecting with Computer Science 27 Representing Images • Screen image made up of small dots of colored light – Dot called “pixel” (picture element), smallest unit – Resolution: # pixels in each row and column – Each pixel is stored in the computer as a binary pattern • RGB encoding – Red, blue, and green assigned to eight of 24 bits – White represented with 1s, black with 0s – Color is the amount of red, green, and blue specified in each of the 8-bit sections
  • 28. Connecting with Computer Science 28 Representing Images (continued) • Images, such as photos, stored with pixel-based technologies • Large image files can be compressed (JPG, GIF formats) • Moving images can also be compressed (MPEG, MOV, WMV)
  • 29. Connecting with Computer Science 29 Representing Sounds • Sound represented as waveform with – Amplitude (volume) and – Frequency (pitch) • Computer samples sounds at fixed intervals – Samples given a binary value according to amplitude – # bits in each sample determines amplitude range – For CD-quality audio • Sound must be sampled over 44,000 times a second • Samples must allow > 65,000 different amplitudes
  • 31. Connecting with Computer Science 31 One Last Thought • Binary code is the language of the machine • Knowledge of base 2 and base 16 prerequisite to knowledge of machine language • Computer scientists are more effective with binary and hexadecimal concepts
  • 32. Connecting with Computer Science 32 Summary • Knowledge of alternative number systems essential • Machine language based on binary system • Hexadecimal used to represent binary numbers • Power rule for numbers defines self-multiplication • Any number can be represented in any base
  • 33. Connecting with Computer Science 33 Summary (continued) • Positional value: weight based on digit position • Counting processes similar for all bases • Conversion between bases is one-to-one mapping • Arithmetic defined for all bases • Data representation: bits, nibbles, bytes, words
  • 34. Connecting with Computer Science 34 Summary (continued) • Two’s complement: technique for storing signed numbers • Floating point notation: system used to represent fractions and irrationals • ASCII and Unicode: character set standards • Image representation: based on binary pixel • Sound representation: based on amplitude samples