Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
DATA REPRESENTATION CONVERSION.
ENGIN112 L4: Number Codes and Registers ENGIN 112 Intro to Electrical and Computer Engineering Lecture 4 Number Codes and Registers.
CHAPTER 2 Number Systems, Operations, and Codes
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
Data Representation COE 205
Binary Representation
CS 151 Digital Systems Design Lecture 4 Number Codes and Registers.
Level ISA3: Information Representation
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
EECC341 - Shaaban #1 Lec # 3 Winter Binary Multiplication Multiplication is achieved by adding a list of shifted multiplicands according.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Lesson 2 0x Coding ASCII Code.
Number Systems and Codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Computers Organization & Assembly Language
Numbering Systems CS208.
Digital Systems and Logic Design
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Chapter 3 Data Representation
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Chapter 2 – Number Systems and Codes Copyright © 2011, 2007, 2004, 2001, 1998 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
CS151 Introduction to Digital Design
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Computer System Architecture © Korea Univ. of Tech. & Edu. Dept. of Info. & Comm. Chap. 2 Number Systems and Codes Binary to Decimal Conversions.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Computer Number System
Chapter 1: Binary Systems
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
AGBell – EECT by Andrew G. Bell (260) Lecture 2.
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.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
Ch2 Number systems and codes
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.
Chapter 1 Digital Systems and Binary Numbers
Number Systems and Codes
Lec 3: Data Representation
Data Representation.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 : INTRODUCTION
Introduction to Chapter 2
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Chapter 3 Data Representation
2 Number Systems and Codes Edited by Jerry Bernardini.
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Number Systems and Codes
Digital Systems: Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
Chapter Four Data Representation in Computers By Bezawit E.
Chap. 2 Number Systems and Codes
Presentation transcript:

Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci

Binary  Decimal  Convert a binary number, , to a decimal number by summing the positional weights that contain “1”. How about Decimal  Binary? = 37 10

Decimal  Binary  Use repeated division: Divide the decimal number by 2. The remainder of this division is the LSB Continue dividing the results, adding the remainders to the left of the LSB until a quotient of zero is obtained. The last division is always two into 1 giving a result of 0 with a remainder of 1. This 1 is the MSB. Additional zeros can be added padding the binary number so the total digits are some multiple of 8.

Repeated Division: Example 1 Until a quotient of “0” is obtained

Repeated Division: Example 2

Repeated Division: Flow Chart Similar procedure can be used to convert from decimal to other number systems. Check your solutions by converting back to decimal.

Hexadecimal Number System  Hexadecimal number system uses base-16  The characters used in hex are:  Digits 0~9  Letters A, B, C, D, E, F  The digit positions are weighted as powers of 16, rather than as powers of 10 as in the decimal system

Counting in Hex  Why Hexadecimal? It is useful to represent long strings of bits. Each character in hex can represent 4 bits reducing the length of a number to a quarter of the original size. It makes binary numbers more “readable”.  Counting in hex restarts at zero and produces a carry after the count reaches F in order to increment to the next value.

Hex  Decimal Conversion Multiplying each hex digit by its positional weight. Example:

Decimal  Hex Conversion  Remember the repeated division?  Divide the decimal number by 16  The 1 st remainder is the LSB and the last is the MSB. Note, when done on a calculator, a decimal remainder can be multiplied by 16 to get the result. If the remainder is greater than 9, the letters A~F are used. Until a quotient of “0” is obtained

Decimal  Hex Conversion

Hex  Binary Conversion  Hex  Binary: Each Hex digit is converted to its four-bit binary equivalent 9F2 16 = 9 F =  Binary  Hex:  Convert from binary to hex by grouping bits in four starting with the LSB.  Each group is then converted to the hex equivalent  Leading zeros can be added to the left of the MSB to fill out the last group.  Example: = = 3 A 6 = 3A6 16 Note the addition of leading zeroes

Conversion among Decimal, Binary, Hex Decimal BinaryHexadecimal How to do all the conversions ?

BCD Code  Binary Coded Decimal (BCD) is another way to present decimal numbers in binary form.  BCD is widely used and combines features of both decimal and binary systems.  Each BCD digit is converted to a binary equivalent.

 To convert the number to BCD: = BCD  Each decimal digit is represented using 4 bits.  Each 4-bit group can never be greater than 9.  Reverse the process to convert BCD to decimal Decimal  BCD

BCD  BCD is NOT a number system.  BCD is a decimal number with each digit encoded to its binary equivalent.  The primary advantage of BCD: easy to convert to and from binary.  A BCD number is NOT the same as a straight binary number.

BCD Review Questions Is “ ” a valid BCD?

BYTE, Nibble, WORD  Byte:  Most microcomputers handle and store binary data in groups of 8 bits.  So, special name is given to a string of 8 bits, called a byte.  Two common questions:  How many bytes in a 32-bit string (a string of 32 bits)?  What is the largest decimal number that can be represented in binary using two bytes?

BYTE, Nibble, WORD  Byte = 8 bits  Nibble = 4 bits  Word:  Word size in a simple system may be one byte (8 bits)  Word size in a PC is 8 bytes (64 bits)  Word size is specific to particular machines.

Alphanumeric Codes – ASCII Code  Represents characters and functions found on a computer keyboard.  ASCII – American Standard Code for Information Interchange. Seven bit code: 2 7 = 128 possible code groups Table 2-4 lists the standard ASCII codes Applications: To transfer information between computers, between computers and printers, and for internal storage.

Parity Method for Error Detection  Binary data and codes are frequently moved between locations. For example: Digitized voice over a microwave link. Storage and retrieval of data from hard disks. Communication between computer systems over telephone lines using a modem.  Electrical noise can cause errors during transmission.  Many digital systems employ methods for error detection (and sometimes correction).

Parity Method for Error Detection  The parity method of error detection requires the addition of an extra bit to a code group.  This extra bit is called the parity bit.  The bit can be either a 0 or 1, depending on the number of 1s in the code group.  There are two methods: even and odd.

 Even Parity Method: The total number of “1”s in a group, including the parity bit, must add up to an even number. The binary group would require the addition of a parity bit The parity bit may be added at either end of a group.  Odd Parity Method: The total number of “1”s in a group, including the parity bit, must add up to an odd number. Parity Method for Error Detection

 The transmitter and receiver must “agree” on the type of parity-checking being used.  Two bit errors would not indicate a parity error.  Both odd and even parity methods are used, but even seems to be used more often.

Schematic for Even Parity Generator