BINARY CODE 350151 – Digital Circuit 1 Choopan Rattanapoka.

Slides:



Advertisements
Similar presentations
KFUPM COE 202: Digital Logic Design Number Systems Part 3 Courtesy of Dr. Ahmad Almulhem.
Advertisements

Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
NUMBERS DESCRIBE THE SYSTEM
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
ECE 331 – Digital System Design
Overview Digital Systems and Computer Systems Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary.
Number Systems and Codes In PLC
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
1.6 Signed Binary Numbers.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
NUMBER SYSTEM AND CONVERSION Digital Circuit Choopan Rattanapoka.
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.
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Binary Codes Computers and other digital systems "work" with binary numbers. I/P & O/P is usually done using decimal numbers, alphabetics, special symbols.
Digital Systems and Logic Design
©zaher elsir Sudan Academy for Banking & Financial Sciences Decimal Number System Base (Radix)10 Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9 e.g The magnitude.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Chapter 3 Data Representation
Binary Arithmetic & Data representation
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
The Digital Codes.
Morgan Kaufmann Publishers
Binary Code.
UNIVERSAL COLLEGE OF ENGINEERING AND TECHNOLOGY PREPARED BY:- Chirag Parmar ( ) Kashish Soni ( ) Maitrey Bhatt( )
Introduction to Computer Design CMPT 150 Section: D Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1.
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.
1 Pertemuan 2 Network Math. Discussion Topics Binary presentation of data Bits and bytes Base 10 number system Base 2 number system Converting decimal.
LOGIC GATES & TRUTH TABLE – Digital Circuit 1 Choopan Rattanapoka.
Digital Logic Design Week 3
– Digital Circuit 1 Choopan Rattanapoka
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary Numbers.
Number systems, Operations, and Codes
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
CEC 220 Digital Circuit Design Binary Codes
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic.
Module –I Codes: Weighted and non-weighted codes
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Exercise 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Digital Logic Design Lab 1,2 By Nora Alaqeel.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Decoder Chapter 12 Subject: Digital System Year: 2009.
Introduction to signals The signals are broadly classified into two categories: 1. Analog Signals. 2. Digital signals.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Understanding binary Understanding Computers.
Unit 18: Computational Thinking
CHAPTER 1 : INTRODUCTION
Number systems and codes
Data Encoding Characters.
Complement Theory 1’s and, 2’s complement operation
Diminished Radii Complement and codes
Digital Logic & Design Lecture 05
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
Table 1.1 Powers of Two.
Learning Intention I will learn how computers store text.
ECE 331 – Digital System Design
FIGURE 1-1 Examples of Voltage Ranges and Waveforms for Binary Signals
Computer Architecture CST 250
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

BINARY CODE – Digital Circuit 1 Choopan Rattanapoka

Binary Code Decimal  Most computer works internally with binary numbers, However, the input-output generally uses decimal number.  Most logic circuits only accept two-valued signal, the decimal number must be coded in terms of binary signals.

B.C.D. (4-bit code) : (1)  Code  Sometime calls BCD code.  Each decimal digit is represented by 4-bit binary number  N = 8b 4 + 4b 3 + 2b 2 + b 1  Ex : 5  8x0 + 4x1 + 2x0 + 1  0101 Example :  Binary equivalent   Code  

B.C.D. (4-bit code) : (2)  Convert back to decimal number  Ex : Answer : =

B.C.D (4-bit code) : Excess-3  Excess-3 or XS3 based on code but add 3 on each decimal digit before convert it to with style  N + 3 = 8b 4 + 4b 3 + 2b 2 + b 1 Example :  Add 3 on each decimal digit  811  Code   Thus, Excess-3 of is

Exercise 1  Convert these decimal numbers to binary number, binary code, and Excess-3 binary code:  25  128  200  From these binary codes( code, and Execess-3), convert them to decimal numbers:   

Other B.C.D. codes  5-bit code  2-out-of-5   Shift counter   More than 5-bit code  Biquinary code  code  Ring counter code

Gray Code  To represent D decimal values, a Gray code of N bits is required. where N >= log 2 D  Example : To represent 16 values of decimal number we need at least N >= log 2 16 N >= 4  Gray code is also called a minimum changed code because only 1 bit changes value between any two consecutive Gray codes.

Generating Gray Code : 1 st method 0 1 Use alternative mirroring of the pattern 1 bit Gray Code 0 1 Alternative Mirror Fill 0 on the first part and Fill 1 on the second part 2-bit Gray code

Generating Gray Code: 1 st Method bit Gray code bit Gray code

Generating Gray Code: 2 nd method  4-bit Binary b 3 b 2 b 1 b 0  4-bit Gray code g 3 g 2 g 1 g 0  g 0 = b 0 b 1  g 1 = b 1 b 2  g 2 = b 2 b 3  g 3 = b 3 = Exclusive-OR 0 0 = = = = 0

Generating Gray Code: 2 nd method  Example: Convert a decimal number to Gray code. N >= log 2 60 approx. N = 6 We need 6-bit Gray code ( g 5 g 4 g 3 g 2 g 1 g 0 ) Binary equivalent of  g 0 = b 0 b 1 = 0 0 = 0 g 1 = b 1 b 2 = 0 1 = 1 g 2 = b 2 b 3 = 1 1 = 0 g 3 = b 3 b 4 = 1 1 = 0 g 4 = b 4 b 5 = 1 1 = 0 g 5 = b 5 = 1 Ans : Grey code of is

Gray Code to Binary  Example : Convert Gray code to Binary number Gray code Binary

Exercise 2  How many minimum bit do we need for Gray code in order to express 128 decimal values ?  Find Gray codes for the following decimal numbers:  4  20  65  90  120  Convert these gray codes to binary number  001    10101

ASCII  Many applications of computers require the processing of data which contains numbers, letters, and other symbols.  The common alphanumeric code is ASCII code (American Standard Code for Information Interchange).  ASCII is 7-bit code

ASCII standard

ASCII extension (8-bit)

Example :  What is the ASCII code for “Hi”.  H    i   Answer : Hi 

Exercise 3 (TODO)  Find binary, 8421BCD, and Excess-3 of the following decimal numbers:  32, 128, 210  Find decimal numbers of this 8421 BCD:  ,  Find decimal numbers of this Excess-3:  ,  Find Gray codes for the following decimal numbers:  10, 30, 85  Find decimal numbers of this Gray codes:  0100, 10001,  Find the ASCII code (7-bit) for theses words :  L33T, OMG!, YaHoo  Find word from this ASCII code : 