Digital Systems: Number Systems and Codes

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Storage of Bits Computers represent information as patterns of bits
Digital Systems Number Systems and Codes Wen-Hung Liao, Ph.D.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Number System and Codes
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
Number Systems and Codes In PLC
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
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.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
CSC212 – Computer Organization and Design
Digital Systems and Logic Design
Morgan Kaufmann Publishers
Chapter 2 – Number Systems and Codes Copyright © 2011, 2007, 2004, 2001, 1998 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights.
Bits, Bytes, Words Digital signal. Digital Signals The amplitude of a digital signal varies between a logical “0” and logical “1”. – The information in.
Yuh-Jzer JoungDigital Systems1 Number Systems decimal number : 7397=7× × × ×10 0 a 4 a 3 a 2 a 1 a 0. a -1 a -2 = a 4 ×10 4 +a 3 ×10.
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.
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.
1 Chapter 2 Number Systems, Operations, and Codes.
Number Systems and Codes
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
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.
Data Representation Conversion 24/04/2017.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Number Representation and Arithmetic Circuits
AGBell – EECT by Andrew G. Bell (260) Lecture 2.
Digital Logic & Design Adil Waheed Lecture 03. Range of Binary Numbers Processors can handle 64-bit unsigned binary values. Maximum unsigned decimal number.
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
Digital Systems: Number Systems and Codes Wen-Hung Liao, Ph.D.
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.
N 3-1 Data Types  Binary information is stored in memory or processor registers  Registers contain either data or control information l Data are numbers.
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.
Number Systems and Codes
Unit 18: Computational Thinking
CHAPTER 1 : INTRODUCTION
Digital Arithmetic Wen-Hung Liao, Ph.D..
Introduction to Chapter 2
Number Systems.
CSCE 211: Digital Logic Design
Number System conversions
2 Number Systems and Codes Edited by Jerry Bernardini.
Number Systems and Codes
CSCE 211: Digital Logic Design
CSCE 211: Digital Logic Design
Digital Logic & Design Lecture 05
CSCE 211: Digital Logic Design
Data Representation Conversion 05/12/2018.
CSCE 211: Digital Logic Design
Table 1.1 Powers of Two.
Number Systems Rayat Shikshan Sanstha’s
ECE 331 – Digital System Design
Number Systems Rayat Shikshan Sanstha’s
Number Systems.
Chap. 2 Number Systems and Codes
Error Detection and Correction
Presentation transcript:

Digital Systems: Number Systems and Codes Wen-Hung Liao, Ph.D.

Objectives Convert a number from one number system (decimal, binary, hexadecimal, gray code) to its equivalent in one of the other number systems. Cite the advantages of the hexadecimal number systems. Count in hexadecimal. Gray code Represent decimal numbers using the BCD code; cite the pros and cons of using BCD. Understand the difference between BCD and straight binary. Understand the purpose of alphanumeric codes such as the ASCII code. Explain the parity method for error detection. Determine the parity bit to be attached to a digital data string

Binary-to-Decimal Conversions Example 1: 110112 Example 2: 101101012

Decimal-to-Binary Conversions Method one: reverse the process of binary-to-decimal conversion. Method two: repeated division LSB: Least Significant Bit MSB: Most Significant Bit Example: 3710=1001012

Hexadecimal Number System The hexadecimal number system has a base of 16. Sixteen possible digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Hex-to-decimal conversion Decimal-to-hex conversion Hex-to-binary conversion Binary-to-hex conversion

BCD Code Binary-Coded-Decimal versus straight binary coding. 0  0000, 1 0001, 20010, 30011, 40100, 50101, 60110, 70111, 8 1000, 9 1001 874 (decimal) 1000 0111 0100 (BCD) Nibble: half byte

Gray Code 3-bit gray code Hamming distance between consecutive codes=1 Decimal Binary Gray 000 1 001 2 010 011 3 4 100 110 5 101 111 6 7

Conversion Algorithms From binary to Gray: From Gray to binary: Note: A XOR B = A’B+AB’ Let B[n:0] be the input array of bits in the usual binary representation, [0] being LSB Let G[n:0] be the output array of bits in Gray code G[n] = B[n] for i = n-1 downto 0 G[i] = B[i+1] XOR B[i] Let G[n:0] be the input array of bits in Gray code Let B[n:0] be the output array of bits in the usual binary representation B[n] = G[n] for i = n-1 downto 0 B[i] = B[i+1] XOR G[i]

Alphanumeric Codes ASCII code: American Standard Code for Information Interchange The ASCII code is a 7 bit code, so it has 2^7=128 possible code groups. Refer to Table 2-4.

Parity Method for Error Detection Whenever information is transmitted from one device to another device, errors can occur due to noise. Parity method can be used to detect error. A parity bit is an extra bit that is attached to a code group that is being transferred. In even-parity method, the value of the parity bit is chosen so that the total # of 1s in the code group (including the parity bit) is an even number. In odd-parity method, the value of the parity bit is chosen so that the total # of 1s in the code group (including the parity bit) is an odd number.

Example ASCII ‘C’: 1000011 Even-parity method: 1 1000011 Odd-parity method: 0 1000011 The parity bit is issued to detect any single-bit errors that occur during the transmission