Computer Systems 1 Fundamentals of Computing

Slides:



Advertisements
Similar presentations
Base 10 Denary Decimal
Advertisements

ICS312 Set 2 Representation of Numbers and Characters.
Representing Numbers: Integers
DATA REPRESENTATION CONVERSION.
EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
Binary & Decimal numbers = 3* * *10 + 5*1 = 3* * * *10 0 Decimal system: Ten digits: 0,1,2,3,…,9 Example:
CS1800 Summer 2014 Binary Numbers. Decimal Integers  What does a decimal number like "87294" really mean?  More generally.
Chapter 1 1 Number Systems. 2 Objectives  Understand why computers use binary (Base-2) numbering.  Understand how to convert Base-2 numbers to Base-
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Revision Introductory Lesson
Binary and Hexadecimal Numbers
Number Systems.
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Stuart Cunningham - Computer Platforms COMPUTER PLATFORMS Von Neumann Architecture & Terminology & Performance Week 3.
Number Representations and Computer Arithmetic. CS 21a 9/23/02 Odds and Ends Slide 2 © Luis F. G. Sarmenta and John Paul Vergara, Ateneo de Manila University.
Numbering systems.
Numbering Systems CS208.
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
Computer System & Binary Review. Memory Model What memory is supposed to look like.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix.
The Hexadecimal Number System and Memory Addressing ISAT 121.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
1 3 Computing System Fundamentals 3.2 Computer Architecture.
AEEE2031 Data Representation and Numbering Systems.
Visualizing Decimal and Binary
Data Representation Bits, Bytes, Binary, Hexadecimal.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
* Numeral Systems: A writing method for expressing numbers is called a “Numeral System". In the most common numeral system, we write numbers with combinations.
Binary Decimal Hexadecimal
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Numbering Systems and Conversion Understand How Computing Devices Work 1.
Number Systems Part 2. Counting in Binary DecimalBinary
Understanding Computers
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Binary Numbers. Base 10 and Base 2  We normally work with numbers in base 10.  In base 10 we use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.  Everything.
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
Number systems Visualizing Decimal and Binary. We count in base 10 because people started by counting on their fingers Base 10 is a number system that.
Number systems. Binary system. Bits and bytes. Modern computers “speak” in a digital language composed of 2 digits. The machine language of modern computers.
Dr. Clincy Slide 1 CS Chapter 2 (Part 1 of 3) Dr. Clincy Professor of CS Ch 2 Appendix pages will not be on the exam – already covered this.
Programmable Logic Controller
Binary & Hex Review.
Lecturer: Santokh Singh
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Understanding binary Understanding Computers.
Computer basics.
Binary, Denary, Hexadecimal Conversion Binary Addition
Data Representation – numbers Binary conversion Hexadecimal Negative numbers Binary addition Binary shifts.
Dr. Clincy Professor of CS
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
Dr. Clincy Professor of CS
Fundamentals of Data Representation
Data Representation – Numbers
Digital Electronics and Microprocessors
(return of the…) Data blast
Chapter Four Data Representation in Computers By Bezawit E.
Numeral systems (radix)
Binary & Hex Review.
UNIT – 3 & 4. Data Representation and Internal
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Presentation transcript:

Computer Systems 1 Fundamentals of Computing Data Representation Decimal, Binary, Hexadecimal

Data Representation Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16) Computer Systems 1 (2004-2005)

Decimal Base 10 Numbers we use in everyday life 10 values then increment to next digit position on left 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each position represents a value of 10, to the positions power Units (100), Tens (101), Hundreds (102), etc... ‘Ten fingers & ten toes’ Decimal numbers E.g.- 5 64281 -3564 Computer Systems 1 (2004-2005)

Binary Base 2 Commonly used in computers to represent data Used for all calculations and logic test results 2 values, then increment next digit position on left 0 or 1 Each position represents a value of 2 to the positions power 20 (1), 21(2), 22 (4), 23 (8), 24 (16), etc… On or off (Digital) Binary numbers E.g.- 01 1010110 00000000 11111111 Computer Systems 1 (2004-2005)

Binary Bits ‘n’ Bytes A bit is a single binary digit (1 or 0) A kilobit (KB) is 1024 bits A byte is eight bits Four bits are sometimes called a nibble A kilobyte (Kb) is 1024 bytes A megabyte (Mb) is 1024 kilobytes A gigabyte (Gb) is 1024 megabytes A terabyte (Tb) is 1024 gigabytes Computer Systems 1 (2004-2005)

Padding, Cladding and Loft Insulation (?!?) Often when writing binary values we will use a notation method called ‘padding’ This involves padding a value with zeros on the left up to the nearest byte size Extra zeros become insignificant Makes reading and working with values easier The first 1 encountered on the left is most significant bit (MSB) The last 1 on the furthest right is least significant bit (LSB) Example Binary number 1011 Padded to a byte = 00001011 Binary 010 Padded to a byte = 00000010 This could have originally been just ‘10’ too! Computer Systems 1 (2004-2005)

Converting Decimal & Binary To convert decimal to binary: If the decimal number is ODD, write a ‘1’ on the far right hand side OR if the decimal number is EVEN, write a ‘0’ on the far right hand side Divide the decimal number by TWO If there is a remainder then ignore it If the number you have is ODD, write a ‘1’ to the left of the previous digit OR if the number is EVEN, write a ‘0’ to the left of the previous digit Repeat until your decimal number is 0 Computer Systems 1 (2004-2005)

Converting Decimal & Binary Decimal ’15’ = ODD = 1 15/2 = 7.5 = 7 = ODD = 11 7/2 = 3.5 = 3 = ODD = 111 3/2 = 1.5 = 1 = ODD = 1111 Binary ‘1111’ = Decimal ’15’ !!!! We can ‘pad’ our binary number with 0’s Eg: 00001111 Decimal ’32’ = EVEN = 0 32/2 = 16 = EVEN = 00 16/2 = 8 = EVEN = 000 8/2 = 4 = EVEN = 0000 4/2 = 2 = EVEN = 00000 2/2 = 1 = ODD = 100000 Binary ‘100000’ = Decimal ’32’ !!!! Eg: 00100000 Computer Systems 1 (2004-2005)

Converting Binary & Decimal To convert binary to decimal: Write out the binary number Add the positional values to each digit Where there is a ‘1’ below the positional value highlight that positional value Once all 1’s in the binary number have highlighted their positional values Add all highlighted values together Positional values: 512 256 128 64 32 16 8 4 2 1 These values can of course increase Doubled with each positional move left Computer Systems 1 (2004-2005)

Converting Binary & Decimal E.g.- Binary number: 00011011 Add positional values: 128 64 32 16 8 4 2 1 0 0 0 1 1 0 1 1 Highlight the positional values Add the highlighted values together: 16+8+2+1 = 27 So Binary 00011011 = Decimal 27 !! Computer Systems 1 (2004-2005)

Hexadecimal Base 16 Another common format for data representation Easy to map against binary Used to easily represent large numbers Common usage is memory locations 16 values then increment next digit on left position 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Each position represents a value of 16 to the positions power 160 (1), 161 (16), 162 (256), 163 (4096), 164 (65536), etc… Hexadecimal numbers E.g- 5 10 FF FB 19 Computer Systems 1 (2004-2005)

Hexadecimal Values DECIMAL HEXADECIMAL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F DECIMAL HEXADECIMAL Computer Systems 1 (2004-2005)

Converting Decimal & Hexadecimal To convert decimal to hexadecimal: Write out the decimal number Write out the hexadecimal positional values Find the largest hex positional value that your decimal number will divide into Divide your decimal number by that hex positional value Take the answer( ignore the remainder) and add it to the left hand side of your hex answer multiply this number by it’s positional value and then subtract it from your decimal number Take what’s left of your decimal number and repeat the process until you have nothing left We can also pad out Hex values with zeros if we want too! Computer Systems 1 (2004-2005)

Converting Decimal & Hexadecimal E.g.- Decimal 280 Write Hex positional values 1048576 65536 4096 256 16 1 Divide 280 by 256 (=1) Multiply 1 by 256 (=256) Subtract 256 from 280 (280-256=24) Divide 24 by 16(=1) Multiply 1 by 16 (=16) Subtract 16 from 24 (24-16=8) Divide 8 by 1 (=8) Write in the 8 0 0 0 1 1 8 Hex number = 118 Computer Systems 1 (2004-2005)

Converting Hexadecimal & Decimal To convert hexadecimal to decimal: Write out the hexadecimal number Add the positional values to each digit Where there is a value greater than ‘0’ below the positional value highlight that positional value Once all positional values have been highlighted, multiply the number below, by it’s positional value Add all results of highlighted values together Positional values: 1048576 65536 4096 256 16 1 These values can of course increase to the power of 16 Computer Systems 1 (2004-2005)

Converting Hexadecimal & Decimal E.g.- Hex number 4C Add positional values 1048576 65536 4096 256 16 1 0 0 0 0 4 C Highlight positional values Multiply positional values by the number below 4*16 = 64 C*1 = 12*1 = 12 Add these together 64+12=76 Computer Systems 1 (2004-2005)

Notation of Numerical Values Very often we will have to write many different base value numbers Performing calculations or comparisons For easy reading, the following conventions are used: Decimal Will either appear with no special notation or with a subscript ‘10’ after the number e.g.- 365 or 36510 Binary Using subscript ‘2’ after the number e.g.- 100111012 Hexadecimal Using a subscript ‘16’ after the number, of a prefix ‘0x’ e.g.- 4D16 or 0x4D Computer Systems 1 (2004-2005)

CS1: Week 3 What you know now: Hexadecimal Decimal principles Binary Method Notation Bits, bytes, etc. Conversion Hexadecimal Computer Systems 1 (2004-2005)