Numbering System TODAY AND TOMORROW 11th Edition

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation in Computers
Digital Fundamentals Floyd Chapter 2 Tenth Edition
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Number Systems and Arithmetic
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Number Systems and Codes
Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Number Systems Binary and Hexadecimal. Base 2 a.k.a. Binary  Binary works off of base of 2 instead of a base 10 like what we are taught in school 
Numeral Systems Subjects: Numeral System Positional systems Decimal
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Chapter 3 Data Representation
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: binary, decimal, hexadecimal and octal. Conversion between various number systems Number systems: binary, decimal, hexadecimal and octal.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Number systems, Operations, and Codes
Data Representation, Number Systems and Base Conversions
AEEE2031 Data Representation and Numbering Systems.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Introduction To Number Systems Binary System M. AL-Towaileb1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Computer Number System
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Introduction to Digital Electronics Lecture 2: Number Systems.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
Fall’ 2014 Number System CSE Number System How Computers Represent Data Binary Numbers The Binary Number System Bits and Bytes Text Codes Binary.
Introduction to signals The signals are broadly classified into two categories: 1. Analog Signals. 2. Digital signals.
1. Binary, Decimal, Hexadecimal and Octal. 2. Conversion between various number systems. Number Systems:
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Some basic concepts underlying computer archi­tecture
Introduction To Number Systems
Number Systems & Binary Arithmetic
Number Systems and Codes
NUMBER SYSTEMS.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 : INTRODUCTION
Introduction to Chapter 2
Number Systems.
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
COMPUTING FUNDAMENTALS
ITE102 – Computer Programming (C++)
Chapter 3 Data Representation
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Introduction to IT By: Muhammed s. anwar.
Number Systems and Codes
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Digital Electronics & Logic Design
Digital Logic & Design Lecture 02.
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Chapter 2: Number Systems
Chapter Four Data Representation in Computers By Bezawit E.
Number Systems Rayat Shikshan Sanstha’s
Binary to Decimal Conversion
Number Systems Rayat Shikshan Sanstha’s
Information Representation
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

Numbering System TODAY AND TOMORROW 11th Edition Understanding Computers, 11th Edition 1

The Decimal and Binary Numbering System The decimal (base 10), numbering system uses 10 symbols—the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9—to represent all possible numbers and is the numbering system people use most often. The binary (base 2), numbering system is used extensively by computers to represent numbers and other characters. This system uses only two digits—0 and 1. Chapter 7 Understanding Computers, 11th Edition

Representing Data - Decimal Numbers (Base 10) We use Decimal numbers: number based on 10 digits, 0, 1, 2, 3,…, 9 123 = (1 x 102) + (2 x 101) + (3 x 100) 764 =764(10)=7x102 + 6x101 + 4x100 where in base 10, digits 0,1,2,…7,8,9 are permissible (NOT 10). Note 100 = 1 In 764 the 7 is the most significant digit (MSD) and 4 is the least significant digit (LSD) Can use any Base n. Since digital work largely deals with two signals we select n=2 Binary uses the same principle Chapter 7 Understanding Computers, 11th Edition

Decimal Numbers 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 numbers is ten, because only ten symbols (0 through 9) are used to represent any number. The column weights of decimal numbers are powers of ten that increase from right to left beginning with 100 =1: …105 104 103 102 101 100. For fractional decimal numbers, the column weights are negative powers of ten that decrease from left to right: 102 101 100. 10-1 10-2 10-3 10-4 …

Example Solution Decimal Numbers Decimal numbers can be expressed as the sum of the products of each digit times the column value for that digit. Thus, the number 9240 can be expressed as      (9 x 103) + (2 x 102) + (4 x 101) + (0 x 100) or 9 x 1,000 + 2 x 100 + 4 x 10 + 0 x 1 Example Express the number 480.52 as the sum of values of each digit. Solution 480.52 = (4 x 102) + (8 x 101) + (0 x 100) + (5 x 10-1) +(2 x 10-2)

Binary Numbers For digital systems, the binary number system is used. Binary has a radix of two and uses the digits 0 and 1 to represent quantities. The column weights of binary numbers are powers of two that increase from right to left beginning with 20 =1: …25 24 23 22 21 20. For fractional binary numbers, the column weights are negative powers of two that decrease from left to right: 22 21 20. 2-1 2-2 2-3 2-4 …

Representing Data - Binary Numbers (Base2) The binary number 101 is: (1 x 22) + (0 x 21) + 1 = (1 x 4) + (0 x 2) + 1 = 4 + 0 + 1 = 5 Eg 1011 = (1 x 23) + (0 x 22 ) + (1 x 21) + (1 x 20) = 8 + 0 + 2 + 1 = 11 1(10)=001(2)= or 0x22 + 0x21 + 1x20, where 20=1 3(10)=011(2)= or 0x22 + 1x21 + 1x20 10(10)=1010(2)= or 1x23 + 0x22 + 1x21 + 0x20 29(10)= 11101(2)= or 1x24+1x23+1x22+0x21+1x20 In 110010(2) the MSB=1 and LSD =0 Chapter 7 Understanding Computers, 11th Edition

Example Solution Binary Conversions The decimal equivalent of a binary number can be determined by adding the column values of all of the bits that are 1 and discarding all of the bits that are 0. Example Convert the binary number 100101.01 to decimal. Solution Start by writing the column weights; then add the weights that correspond to each 1 in the number. 25 24 23 22 21 20. 2-1 2-2 32 16 8 4 2 1 . ½ ¼ 1 0 0 1 0 1. 0 1 32 +4 +1 +¼ = 37¼

Example Solution Binary Conversions You can convert a decimal whole number to binary by reversing the procedure. Write the decimal weight of each column and place 1’s in the columns that sum to the decimal number. Example Convert the decimal number 49 to binary. Solution The column weights double in each position to the right. Write down column weights until the last number is larger than the one you want to convert. 26 25 24 23 22 21 20. 64 32 16 8 4 2 1. 0 1 1 0 0 0 1.

Example Solution Binary Conversions You can convert decimal to any other base by repeatedly dividing by the base. For binary, repeatedly divide by 2: Convert the decimal number 49 to binary by repeatedly dividing by 2. Example Solution You can do this by “reverse division” and the answer will read from left to right. Put quotients to the left and remainders on top. Answer: 1 1 remainder Quotient 1 49 2 1 3 6 12 24 Decimal number base Continue until the last quotient is 0

Finding Binary Form of a Decimal Number #1- Repeatedly divide the decimal number by 2 and retain the remainder as the LSB. Find 29(10) 29/2 = 14 rem 1, LSB = 1 14/2 = 7 rem 0, next bit = 0 7/2 = 3 rem 1, next bit = 1 3/2 = 1 rem 1, next bit = 1 1/2 = 0 rem 1, MSB = 1 So, 29(10) = 11101 #2- Find the largest power of 2 less than the number. That becomes the MSD. Subtract these numbers and repeat the process. 24 = 16, (MSB), 29-16 = 13, 23 = 8, 13-8=5, 22 = 4, 5-4=1, 20 = 1, LSB Therefore 29(10) = 11101 Chapter 7 Understanding Computers, 11th Edition

Base n Binary – 2 Octal – 8 Decimal – 10 Hexadecimal – 16 When dealing with collection of bits like binary words representing text characters using the ASCII (American Standard Code for Information Interchange) code – it is inconvenient to deal with each individual bit So may use octal (3 bit) words or hexadecimal (4 bit) words Chapter 7 Understanding Computers, 11th Edition

The Hexadecimal Numbering System The hexadecimal numbering system is also called the base 16 numbering system because it uses 16 different symbols. Hexadecimal is not itself a code that the computer uses to perform computations or to communicate with other machines. As you can see in Figure 1, each hex character has a 4-bit binary counterpart, so any combination of 8 bits can be represented by exactly two hexadecimal characters. For example, the letter N (represented in ASCII by 01001110) has a hex representation of 4E (see the Binary Equivalent column in Figure 1). Chapter 7 Understanding Computers, 11th Edition

Chapter 7 Understanding Computers, 11th Edition

Converting Between Numbering Systems: Hexadecimal to Decimal similar to converting a binary number to decimal, except the base number is 16 instead of 2. To determine the decimal equivalent of a hexadecimal number : multiply the decimal equivalent of each individual hex character by the appropriate power of 16 and then add the results to obtain the decimal equivalent of that hex number. Chapter 7 Understanding Computers, 11th Edition

Hexadecimal - Base 16 Base 16, using first 16 numerals including 6 letters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Because 16 is a power of 2, can use octal numbers to represent a group of 4 bits Example: 001111102 = 21 + 22 + 23 + 24 + 25 = 2 + 4 + 8 + 16 + 32 = 6210 3E16 = 3x16 + 14 = 6210 Chapter 7 Understanding Computers, 11th Edition

Summary Example Solution Hexadecimal Numbers Binary Hexadecimal Numbers 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Hexadecimal uses sixteen characters to represent numbers: the numbers 0 through 9 and the alphabetic characters A through F. Large binary number can easily be converted to hexadecimal by grouping bits 4 at a time and writing the equivalent hexadecimal character. Express 1001 0110 0000 11102 in hexadecimal: Example Solution Group the binary number by 4-bits starting from the right. Thus, 960E

Summary { Example Solution Hexadecimal Numbers Binary Hexadecimal Numbers 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Hexadecimal is a weighted number system. The column weights are powers of 16, which increase from right to left. { 163 162 161 160 . Column weights 4096 256 16 1 . Example Express 1A2F16 in decimal. Start by writing the column weights: 4096 256 16 1 Solution 1 A 2 F16 1(4096) + 10(256) +2(16) +15(1) = 670310

Hexadecimal to Binary / Binary to Hexadecimal To convert from hexadecimal to binary, we convert each hexadecimal digit separately to 4 binary digits Example, to convert F6A9 to binary, we get F 6 A 9 1111 0110 1010 1001 or 1111011010101001 in binary representation. To convert from binary to hexadecimal, we go through the reverse process. If the number of digits in the binary number is not divisible by 4, we add leading zeros to the binary number to force an even division. F Example, to convert the binary number 1101101010011 to hexadecimal, we get 0001 1011 0101 0011 1 B 5 3 or lB53 in hexadecimal representation. Note that three leading zeros were added to change the initial 1 to 0001 before making the conversion. Chapter 7 Understanding Computers, 11th Edition

Decimal to Binary/Decimal to Hexadecimal Use the remainder method. The decimal number is divided by 2 (to convert to a binary number) or 16 (to convert to a hexadecimal number). The remainder of the division operation is recorded and the division process is repeated using the quotient as the next dividend, until the quotient becomes 0. At that point, the collective remainders (written backwards) represent the equivalent binary or hexadecimal number (see Figure 3). Chapter 7 Understanding Computers, 11th Edition

Chapter 7 Understanding Computers, 11th Edition

Chapter 7 Understanding Computers, 11th Edition

Octal - Base 8 Base 8, using first 8 numerals: 0, 1, 2, 3, 4, 5, 6, 7 Because 8 is a power of 2, can use octal numbers to represent a group of 3 bits Example: 1001112 = 1+2+4+32 = 3910 478 = 4x8 + 7 = 3910 Chapter 7 Understanding Computers, 11th Edition

Summary Example Solution Octal Numbers Decimal Octal Binary Octal Numbers 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 0 1 2 3 4 5 6 7 10 1112 13 14 15 16 17 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Octal uses eight characters the numbers 0 through 7 to represent numbers. There is no 8 or 9 character in octal. Binary number can easily be converted to octal by grouping bits 3 at a time and writing the equivalent octal character for each group. Express 1 001 011 000 001 1102 in octal: Example Solution Group the binary number by 3-bits starting from the right. Thus, 1130168

Summary { Example Solution Octal Numbers Decimal Octal Binary Octal Numbers 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 0 1 2 3 4 5 6 7 10 1112 13 14 15 16 17 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Octal is also a weighted number system. The column weights are powers of 8, which increase from right to left. { 83 82 81 80 . Column weights 512 64 8 1 . Example Express 37028 in decimal. Start by writing the column weights: 512 64 8 1 Solution 3 7 0 28 3(512) + 7(64) +0(8) +2(1) = 198610

Computer Arithmetic Note that with binary and hexadecimal, as in decimal arithmetic, you carryto and borrow from the column to the left as needed as you move from right to left. Instead of carrying or borrowing 10, however—as you would in the decimal system—you carry or borrow 2 (binary) or 16 (hexadecimal). Chapter 7 Understanding Computers, 11th Edition

Quiz 1. For the binary number 1000, the weight of the column with the 1 is a. 4 b. 6 c. 8 d. 10 2. The hexadecimal number 2C has a decimal equivalent value of a. 14 b. 44 c. 64 d. none of the above Chapter 7 Understanding Computers, 11th Edition © 2009 Pearson Education