Number Systems.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

DATA REPRESENTATION CONVERSION.
2.2 General Positional-Number-System Conversion
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Number System Conversions Lecture L2.2 Section 2.3.
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.
Chapter 1 Number Systems and Codes William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle.
Number Systems and Arithmetic
COE 202: Digital Logic Design Number Systems Part 1
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
Number Systems and Codes In PLC
Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE.
Binary and Hexadecimal Numbers
Number Systems.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
CS231 Fundamentals1 Fundamentals What kind of data do computers work with? – Deep down inside, it’s all 1s and 0s What can you do with 1s and 0s? – Boolean.
Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage.
Numbering systems.
Numbering Systems CS208.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
IKI Data Types & Representations Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
1 CS103 Guest Lecture Number Systems & Conversion Bitwise Logic Operations.
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
Number Systems and Codes
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Positional Notation 642 in base 10 positional notation is:
Number Base Conversions
AEEE2031 Data Representation and Numbering Systems.
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Chapter 2 Number Systems Consists of a set of symbols called digits and a set of relations such as +, -, x, /.
Computer Number System
ECE 3110: Introduction to Digital Systems Number Systems.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
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.
Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
CS231: Computer Architecture I Laxmikant Kale Fall 2002.
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Digital Design Chapter One Digital Systems and Binary Numbers
Number Systems and Codes
Number Systems and Binary Arithmetic
CHAPTER 1 : INTRODUCTION
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Number Systems and Binary Arithmetic
Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
Chapter 2: Number Systems
Digital Logic Design (CSNB163)
Chapter 2 Number Systems.
Number Systems Rayat Shikshan Sanstha’s
Numeral systems (radix)
Chapter 2 Number Systems.
Number Systems Rayat Shikshan Sanstha’s
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Presentation transcript:

Number Systems

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 in base r contains r digits 0,1,2,...,r-1 Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9 Numbers are usually expressed in positional notation MSD: most significant digit LSD: least significant digit

Numbers The value of the number is given in the polynomial form

Numbers In addition to decimal, three other number systems are also important: Binary, Octal, and Hexadecimal

Unsigned Binary Numbers The binary number system: Base-2 Two digits: 0 and 1 The digits in a binary number are called bits MSB: most significant bit LSB: least significant bit

Unsigned Binary Numbers

Unsigned Binary Numbers For a computer with the word size of 32-bit - 4 data-bit unit – nibble (half byte) - 8 data-bit unit - byte - 16 data-bit unit – two bytes (half-word) - 32 data-bit unit – word (four bytes) - 64 data-bit unit – double-word

Converting Binary to Decimal For example, here is 1101.01 in binary: (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20) + (0 x 2-1) + (1 x 2-2) = 8 + 4 + 0 + 1 + 0 + 0.25 = 13.25 (1101.01)2 = (13.25)10

Converting Decimal to Binary To convert a decimal integer into binary, keep dividing by 2 until the quotient is 0. Collect the remainders in reverse order To convert a fraction, keep multiplying the fractional part by 2 until it becomes 0. Collect the integer parts in forward order Example: 162.375: So, (162.375)10 = (10100010.011)2 162 / 2 = 81 rem 0 81 / 2 = 40 rem 1 40 / 2 = 20 rem 0 20 / 2 = 10 rem 0 10 / 2 = 5 rem 0 5 / 2 = 2 rem 1 2 / 2 = 1 rem 0 1 / 2 = 0 rem 1 0.375 x 2 = 0.750 0.750 x 2 = 1.500 0.500 x 2 = 1.000

Why does this work? This works for converting from decimal to any base Why? Think about converting 162.375 from decimal to decimal Each division strips off the rightmost digit (the remainder). The quotient represents the remaining digits in the number Similarly, to convert fractions, each multiplication strips off the leftmost digit (the integer part). The fraction represents the remaining digits 162 / 10 = 16 rem 2 16 / 10 = 1 rem 6 1 / 10 = 0 rem 1 0.375 x 10 = 3.750 0.750 x 10 = 7.500 0.500 x 10 = 5.000

Octal and Hexadecimal Numbers The octal number system: Base-8 Eight digits: 0,1,2,3,4,5,6,7 The hexadecimal number system: Base-16 Sixteen digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F For our purposes, base-8 and base-16 are most useful as a “shorthand” notation for binary numbers

Numbers with Different Bases You can convert between base-10 base-8 and base-16 using techniques like the ones we just showed for converting between decimal and binary

Octal Number system(Base8) Binary Code Decimal(BCD) 0 000 1 001 2 010 3 011 4 100 5 101 6 1 10 7 111

Binary and Octal Conversions Converting from octal to binary: Replace each octal digit with its equivalent 3-bit binary sequence Converting from binary to octal: Make groups of 3 bits, starting from the binary point. Add 0s to the ends of the number if needed. Convert each bit group to its corresponding octal digit. = 6 7 3 . 1 2 = 110 111 011 . 001 010 = 10110100.0010112 = 010 110 100 . 001 0112 = 2 6 4 . 1 38 111 7 011 3 110 6 010 2 101 5 001 1 100 4 000 Binary Octal

Binary and Hex Conversions Converting from hex to binary: Replace each hex digit with its equivalent 4-bit binary sequence Converting from binary to hex: Make groups of 4 bits, starting from the binary point. Add 0s to the ends of the number if needed. Convert each bit group to its corresponding hex digit 261.3516 = 2 6 1 . 3 516 = 0010 0110 0001 . 0011 01012 10110100.0010112 = 1011 0100 . 0010 11002 = B 4 . 2 C16 1111 F 1011 B 0111 7 0011 3 1110 E 1010 A 0110 6 0010 2 1101 D 1001 9 0101 5 0001 1 1100 C 1000 8 0100 4 0000 Binary Hex

Unsigned Binary Coded Decimal (BCD)

Number Systems Summary Computers are binary devices We’re forced to think in terms of base 2. We learned how to convert numbers between binary, decimal, octal and hexadecimal We’ve already seen some of the recurring themes of architecture: We use 0 and 1 as abstractions for analog voltages. We showed how to represent numbers using just these two signals.