Introduction to Number System

Slides:



Advertisements
Similar presentations
Chapter 2 : Number System
Advertisements

Floating Point Numbers
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Floating Point Numbers
Data Representation in Computers
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
The Binary Number System
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Binary Number Systems.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Binary Representation and Computer Arithmetic
Binary and Hexadecimal Numbers
The Binary Number System
Data Representation Number Systems.
Simple Data Type Representation and conversion of numbers
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Data Representation – Binary Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
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 Spring Semester 2013Programming and Data Structure1.
Binary Fractions. Fractions A radix separates the integer part from the fraction part of a number Columns to the right of the radix have negative.
Mathematical Toolkit Review. Significant Digits  Nonzero digits are always significant.  All final zeros to the right of the decimal point are significant.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
Number systems, Operations, and Codes
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.
AEEE2031 Data Representation and Numbering Systems.
Number Systems & Operations
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in 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.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Floating Point Numbers
Nat 4/5 Computing Science Lesson 1: Binary
Introduction To Number Systems
Number Representation
Introduction To Computer Science
Number Systems and Binary Arithmetic
COMPUTING FUNDAMENTALS
ITE102 – Computer Programming (C++)
CSE 102 Introduction to Computer Engineering
Number Systems.
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Integers in 2’s compliment Floating point
Data Representation Data Types Complements Fixed Point Representation
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Digital Logic & Design Lecture 02.
ECEG-3202 Computer Architecture and Organization
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Number Representation
Starter Using the fingers on only one hand, what is the highest number you can count to? Rules: You must start at 1 You must count sequentially (i.e.
Storing Integers and Fractions
Prof. Giancarlo Succi, Ph.D., P.Eng.
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

Introduction to Number System For more notes and topics visit: www.eITnotes.com eITnotes.com

Number System When we type some letters or words, the computer translates them in binary numbers as computers can understand only binary numbers. Decimal number system has base 10 as it uses 10 digits from 0 to 9. In decimal number system, the successive positions to the left of the decimal point represent units, tens, hundreds, thousands and so on. A value of each digit in a number can be determined using The digit Symbol value (is the digit value 0 to 9) The position of the digit in the number Increasing Power of the base (i.e. 10) occupying successive positions moving to the left eITnotes.com

Example Decimal number (592): Number Symbol Value Position from the right end Positional Value Decimal Equivalent 5 9 2 2 9 5 1 100 101 102 2*100 = 2 9*101 = 90 5*102 = 500 592 eITnotes.com

Binary number system Uses two digits, 0 and 1. Also called base 2 number system eITnotes.com

(110011)2 = (51)10 Number Symbol Value Position from the right end Positional Value Decimal Equivalent 1 1 0 0 1 1 1 2 3 4 5 20 21 22 23 24 25 1*0 = 1 1*2 = 2 0*4 = 0 0*8 = 0 1*16= 16 1*32= 32 51 eITnotes.com

Cont… A Decimal number can converted into binary number by the following methods: Double-Dabble Method Direct Method eITnotes.com

Double-Dabble Method Divide the number by 2 Write the dividend under the number . This become the new number Write the remainder at the right in column Repeat these three steps until a ‘0’ is produced as a new number Output (bottom to top). eITnotes.com

Convert decimal 17 into binary number Step Remainder 1 Divide 17 by 2 17 8 2 Divide 8 by 2 4 3 Divide 4 by 2 Divide 2 by 2 5 Divide 1 by 2 eITnotes.com

Direct Method Write the positional values of the binary number …. 26 25 24 23 22 21 20 …. 64 32 16 8 4 2 1 Now compare the decimal number with position value listed above. The decimal number lies between 32 and 64. Now place 1 at position 32. 64 32 16 8 4 2 1 1 Subtract the positional value to the decimal number i.e ( 45-32=13) 45 eITnotes.com

Cont.. 45 64 32 16 8 4 2 1 1 45-32 =13 1 1 13-8=5 1 1 1 5-4=1 1 1 1 1 1-1=0 Place 0 at the rest of position value 0 1 0 1 1 0 1 (45)10=(101101)2 eITnotes.com

Decimal number to fractional Binary number Multiply the decimal fraction by 2 Write the integer part in a column The fraction part become a new fraction Repeat step 1 to 3 until the fractional part become zero. Once the required number of digits (say 4) have been obtained , we can stop. eITnotes.com

Example Decimal number is (0.625) Ans: (0.625)10= (0.101)2 Fractional decimal number Operation Product Fractional part of product Integer part of product 0.625 Multiply by 2 1.250 .250 1 0.250 -do- 0.500 .500 1.000 eITnotes.com

Questions Convert decimal 89 into equivalent binary number by using Double-Dabble Method (89)10= (1011001)2 Convert decimal 89 into equivalent binary number by using Direct Method Convert decimal 0.8125 into fractional binary number (0.8125)10 = (0.1101)2 eITnotes.com

Convert Binary to Decimal Direct Method Double Dabble Method eITnotes.com

Direct Method Binary Number Positional value operation 1 1 1 0 0 1 0 1 1*20 0*21 1*22 0*23 0*24 1*25 1*26 1*27 4 32 64 128 = 229 eITnotes.com

Double Dabble Method Multiply left most digit by 2 add to the next digit and so on. 1 1 0 1 2+ 1 0 1 3 0 1 6+ 0 1 6 1 12+ 1 13 (1101)2= (13)10 eITnotes.com

Example Convert Binary number 10111011 to decimal (10111011)2 = (187)10 eITnotes.com

Convert fractional Binary number to Fractional Decimal number Write out the binary number as (-)ve power of two. The various digits positions after binary points are 1,2,3,4…..and so on. Convert each power of two into its decimal equivalent Add these to give the decimal number eITnotes.com

Example . 1 0 1 1 1*2-1 0*2-2 1*2-3 1*2-4 0.5 + 0 + 0.125 + 0.0625 = 0.6875 eITnotes.com

Questions Convert the fractional binary number to decimal number (0.1101) ans= 0.8125 (0.1011) ans= 0.6875 eITnotes.com

Octal number notation Octal is base 8 counting system having digit values 0 through 7 The octal system groups three binary bits together into one digit symbol. Octal Binary 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 eITnotes.com

Convert binary number into octal Divide the given binary number into group of three bits (from right to left) Replace each group by its octal equivalent Examples: 11001 101010001110 eITnotes.com

Convert decimal to octal Divide the number by 8 Write the dividend under the number. This become the new number Write the remainder at the right in a column Repeat steps 1 to 3 until a ‘0’ is produced as a new number eITnotes.com

Question Convert decimal 17 to octal number Ans= (17)10 = (21)8 eITnotes.com

Convert octal to decimal number Write out the octal digits as power of 8 Convert each power of 8 into its decimal equivalent term Add these terms to produce the required decimal number eITnotes.com

Example 7 2 1 =7*82 =448 465 2*81 16 1*80 (721)8= (465)10 Ques: Convert the octal 131 to its equivalent decimal number ans: 89 eITnotes.com

Hexadecimal Hexadecimal number system is a base 16 counting system It uses 16 Symbols: 0 to 9 and the capital letter A,B…F. Each Hexadecimal is equivalent to a group of 4 binary bits. eITnotes.com

Hexadecimal Binary 0000 8 1000 1 0001 9 1001 2 0010 A 1010 3 0011 B 1011 4 0100 C 1100 5 0101 D 1101 6 0110 E 1110 7 0111 F 1111 eITnotes.com

Convert binary to Hexadecimal Divide the given binary number into groups of 4 bits each(from right to left). Replace each group by its hexadecimal Equivalent. Questions: Convert (101111100001)2 into its hexadecimal. Ans: (BEI)16. 2. Convert (10101111.0010111)2 into its hexadecimal. Ans: (AF.2E)16 eITnotes.com

Convert Decimal to Hexadecimal Divide the number by 16. Write the dividend under the number. This become the new number. Write the remainder at the right in a column. Repeat steps 1 to 3 until a ‘0’ is produced as a new number. Question: Convert the Decimal 87 to hexadecimal number. (87)10= (57)16 eITnotes.com

Convert hexadecimal to Decimal Write out the Hexadecimal digits as power of 16. Convert each power of 16 into its decimal equivalent term. Add these terms to produce the required decimal number. Question: (A2D)16=(2605)10 eITnotes.com

Data Representation We known that computer work with binary numbers and therefore the numbers, letters, and other symbols have to be converted into their binary equivalents. However, this is not enough in the sense that still we do not know how to store this binary information so that it become suitable for computer processing. eITnotes.com

Cont.. The Representation of a positive integer number is quite straight forward but we are interested to represent positive as well as negative numbers. For a Positive number , the sign bit set to 0 and for negative number the sign bit is set to 1. eITnotes.com

Integer Representation An integer can be represented by fixed point representation The left most bit is considered as sign bit. The magnitude of the number can be represented in following three ways: Signed magnitude representation. Signed 1’s complement representation. Signed 2’s complement representation. eITnotes.com

Signed Magnitude In this representation , if n bit of storage is available then 1 bit is reserved for sign and n-1 bits for the magnitude. The Disadvantage of this representation is that during addition and Subtraction, the sign bit has to be considered along with the magnitude. Sign bit magnitude eITnotes.com

(+0)10 1 (-0)10 Signed 1’s Compliment The 1’s Compliment of a binary integer can be obtained by simply replacing the digit 0 by 1 and digit 1 by 0 Example: 00001100 is 11100111 1 eITnotes.com

Signed 2’s Compliment The 2’s Compliment of a binary number is obtained by adding 1 to 1’s Compliment. Example: (+12)10= 1100 11110011 1’s Compliment 1 11110100 2,s Compliment Therefore, Positive integer 2’s compliment is the negative integer 1 1’s 1 (-12)10 1 eITnotes.com

Question Express the following in signed magnitude form, 1’s Compliment, 2’s Compliment: (35)10 = 100011 eITnotes.com

Floating point representation We can represent a floating point binary number in the following form: ±M * 2±e Where M : is the mantissa or significant e : is the exponent Example: 101.11 10111 * 2-2 101.11 * 20 10.111 *21 1.0111 *22 .10111 * 23 .010111 * 24 eITnotes.com

Cont.. .10111 * 23 M e The Mantissa part of the number is suitably shifted (left or right) to obtain a non zero digit at a most significant position. The activity is known as normalization. In a 16 bit representation, let us assume that 10 bits are reserved for mantissa and 6 for exponent. Sign Sign Mantissa exponent 1 eITnotes.com

Question Represent floating point binary number in 16 bit representation (1110.001) The normalization number is = .1110001 * 24 16 bit representation: Sign Sign 0 111000100 0 00100 M e eITnotes.com