Binary Codes-Digital Logic Design-Lecture Slides, Slides of Digital Logic Design and Programming

This course includes logic operators, gates, combinational and sequential circuits are studied along with their constituent elements comprising adders, decoders, encoders, multiplexers, as well as latches, flip-flops, counters and registers. This lecture includes: Binary, Codes, Distinct, Combinations, Subtraction, Decimal, Digits, Addition, Gray, Excess, 3, ASCII, Character

Typology: Slides

2011/2012

Uploaded on 08/07/2012

anjushree
anjushree 🇮🇳

4.4

(54)

147 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Example
Consider the subtraction (6) (13) = +7
In binary with eight bits the same is written as (11111010
11110011)
This subtraction is changed to addition by taking 2s
complement of the subtrahend ( 13) to give (+ 13)
In binary this is 11111010 + 00001101 = 100000111
Removing the end carry, we obtain the correct answer:
00000111(+7)
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Binary Codes-Digital Logic Design-Lecture Slides and more Slides Digital Logic Design and Programming in PDF only on Docsity!

Example

 Consider the subtraction (–6) – (–13) = +

 In binary with eight bits the same is written as (11111010 –

 This subtraction is changed to addition by taking 2 ’s

complement of the subtrahend (– 13) to give (+ 13)

 In binary this is 11111010 + 00001101 = 100000111

 Removing the end carry, we obtain the correct answer:

Binary Codes

 All symbols in a computer must be represented by a

binary code (binary representation).

 An n-bit binary code is a group of n bits that can represent

up to 2 n distinct combinations of 1’s and 0’s.  Each distinct combination represents a single symbol in the computer.

Multi-Digit BCD

BCD Addition

 BCD only represents each of the decimal digitals 0 through

9 as a single 4-bit binary value.

 When adding two BCD values, if the sum is equal to or less

than 1001 (9), the corresponding BCD value is correct.

 However, when the binary sum is greater or equal to 1010

(10), the result is an invalid BCD value.  To overcome the invalid BCD value add 0110 (6) to the result to obtain the BCD representation and also produces a carry as required.  The use of 0110 (6) works because the difference between a carry in the most significant bit position of the binary sum and a decimal carry differ by 16-10 = 6.

Multi-Digit BCD Addition

BCD Arithmetic

 BCD arithmetic involving negative numbers uses the 10’s complement for representing the negative numbers including the sign digit.  0 (0000) represents a positive sign and 9 (1001) represents a negative sign  As an example, imagine we want to add (+257) + (-160) = +  Note: To obtain 10’s complement of a BCD number, we first take the 9’s complement (by subtraction of each digit from 9) and then add one to least significant digit

Four Different Binary Codes

Gray Code

 It is sometimes convenient to use the Gray code to

represent the digital data when it is converted from analog data

 The advantage of Gray code over straight binary number

sequence is that only one bit in the code group changes when going from one number to the next

Gray Code Vs Binary Code

 C o m p a r e t h e

n u m b e r o f b i t s c h a n g i n g w h e n g o i n g f r o m o n e number to the next:  In Gray code it is always 1 bit.

ASCII Character Code

 The American Standard Code for Information Interchange

(ASCII) uses seven bits to code 128 characters, representing the alphabets, decimal numbers, and various other symbols.  The following ASCII chart allows you to specify the characters in decimal representation by concatenating the column headings to the row headings.  For example, the character 5 is represented in binary as 0110101

ASCII Table (Contd ……)

The End