0% found this document useful (0 votes)
11 views

DLD Lacture 2 Chapter 1 Digital Systems and Binary Numbers

This document discusses digital logic design and binary numbers. It covers topics like binary number systems, number conversions, signed binary representations, binary codes, and storage registers. Many examples are provided to illustrate concepts like addition, subtraction, and encoding of numeric and text data.

Uploaded by

23pwbcs0988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

DLD Lacture 2 Chapter 1 Digital Systems and Binary Numbers

This document discusses digital logic design and binary numbers. It covers topics like binary number systems, number conversions, signed binary representations, binary codes, and storage registers. Many examples are provided to illustrate concepts like addition, subtraction, and encoding of numeric and text data.

Uploaded by

23pwbcs0988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Digital Logic Design I

Chapter 1
Digital Systems and Binary Numbers

Mustafa Kemal Uyguroğlu

Digital Logic Design Ch1-1


Outline of Chapter 1

 1.1 Digital Systems


 1.2 Binary Numbers
 1.3 Number-base Conversions
 1.4 Octal and Hexadecimal Numbers
 1.5 Complements
 1.6 Signed Binary Numbers
 1.7 Binary Codes
 1.8 Binary Storage and Registers
 1.9 Binary Logic

Digital Logic Design Ch1-2


1.6 Signed Binary Numbers

 To represent negative integers, we need a notation for negative


values.
 The convention is to make the sign bit 0 for positive and 1 for
negative.
 Two ways of representation:
1. Signed magnitude convention:
 Representation of signed numbers
 Used in Ordinary arithmetic
 MSB for sign and rest of the bits are used for number (Symbol + magnitude)
2. Signed complement number:
1. Used for implementing negative numbers in Computer
2. In this system, A negative number is represented by its complement
3. 1’s or 2’s complement both can be used but 2’s complement is most
common. Digital Logic Design Ch1-3
1.6 Signed Binary Numbers (Contd.)

 Below table lists all possible four-bit signed binary numbers in the
three representations for “ -9 ”.

Digital Logic Design Ch1-4


Signed Binary Numbers

Digital Logic Design Ch1-5


Signed Binary Numbers:
Arithmetic addition

 The addition of two numbers in the signed-magnitude


system:

 If the signs are the same, we add the two magnitudes and give the sum the
common sign. If the signs are different, we subtract the smaller magnitude
from the larger and give the difference the sign if the larger magnitude.

 This process requires the comparison of the signs and magnitude before
addition and subtraction

Digital Logic Design Ch1-6


Signed Binary Numbers:
Arithmetic addition (Contd.)

 Addition in signed-complement system


 No comparison or subtraction , Only addition
 The addition of two signed binary numbers with negative numbers
represented in signed-2's-complement form is obtained from the
addition of the two numbers, including their sign bits. A carry out of
the sign-bit position is discarded.

 Negative numbers must be initially in 2’s complement


and the sum obtained after addition if negative is in 2’s
complement form of the answer. Digital Logic Design Ch1-7
Signed Binary Numbers
 Arithmetic Subtraction
 In 2’s-complement form:
1. Take the 2’s complement of the subtrahend (for positive and
negative both) and add it to the minuend (including sign bit).
2. A carry out of sign-bit position is discarded.
 A subtraction operation can be changed to an addition operation
if the sign of the subtrahend is changed as shown below;

(  A)  (  B)  (  A)  (  B)
 Example:
(  A)  (  B)  (  A)  (  B)
( 6)  ( 13) (11111010  11110011)
(11111010 + 00001101)
00000111 (+ 7)
Digital Logic Design Ch1-8
Signed Binary Numbers…(contd.)

 A positive number can also be changed to a negative number by


taking its 2’s complement and
 Complement of a negative number in complement form produces
the equivalent positive number.

Digital Logic Design Ch1-9


1.7 Binary Codes (contd.)

 Numbers are represented in digital computer either in binary or in


decimal through a binary code
 It is also possible to perform the arithmetic operations directly in
decimal with all numbers left in a coded form throughout e.g,

Digital Logic Design Ch1-10


1.7 Binary Codes (contd.)

Digital Logic Design Ch1-11


1.7 Binary Codes (contd.)

 BCD Code
 A number with k decimal digits will
require 4k bits in BCD.
 Decimal 396 is represented in BCD
with 12bits as 0011 1001 0110, with
each group of 4 bits representing one
decimal digit.
 A decimal number in BCD is the
same as its equivalent binary number
only when the number is between 0
and 9.
 The binary combinations 1010
through 1111 are not used and have
no meaning in BCD.

Digital Logic Design Ch1-12


Binary Code

 Example:
 Consider decimal 185 and its corresponding value in BCD and binary:

 BCD addition
 If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
 If a 4-bit sum > 9, or if a carry out of the 4-bit group is generated
it is an invalid result. Add 6 (0110) to a 4-bit sum in order to skip
the six invalid states and return the code to 8421. If a carry results
when 6 is added, simply add the carry to the next 4-bit group

Digital Logic Design Ch1-13


Digital Logic Design Ch1-14
Binary Code

 Example:
 Consider the addition of 184 + 576 = 760 in BCD:

Digital Logic Design Ch1-15


BCD Subtraction

 Subtract the two BCD numbers, using the rules for basic binary
subtraction.
 If there is no borrow from the next higher group, no correction is
required.
 If there is borrow from the next group, then (0110) is subtracted
from the difference term of this group.

Digital Logic Design Ch1-16


Binary Codes

 Other Decimal Codes

Digital Logic Design Ch1-17


ASCII Character Codes

 We need to formulate a binary code for the letters of the alphabet.


 An alphanumeric set is a set of elements that includes the 10
decimal digits, the 26 letters of the alphabet and a number of
special characters.
 It contains between 64 and 128 elements if both uppercase and
lowercase letters are included so it need a binary code of seven
bits.
 Standard binary code for the alphanumeric characters is
ASCII(American Standard Code for Information Interchange
(Refer to Table 1.7)

Digital Logic Design Ch1-18


Binary Codes
 American Standard Code for Information Interchange (ASCII) Character Code

Digital Logic Design Ch1-19


Binary Codes

 ASCII Character Code

Digital Logic Design Ch1-20


ASCII CODE

 A popular code used to represent information sent as character-


based data.
 It uses 7-bits to code 128 character:
 94 Graphic printing characters.
 34 Non-printing characters.
 Some non-printing characters are used for text format (e.g. BS =
Backspace, CR = carriage return).

Digital Logic Design Ch1-21


ASCII Properties

 ASCII has some interesting properties:


 Digits 0 to 9 span Hexadecimal values 3016 to 3916
 Upper case A-Z span 4116 to 5A16
 Lower case a-z span 6116 to 7A16
» Lower to upper case translation (and vice versa) occurs by flipping bit 6.

Digital Logic Design Ch1-22


Other Codes

 Since Most computers manipulate an 8-bit quantity as a single


unit called a byte.Therefore , ASCII characters are most often
stored as one per byte.
 Another alphanumeric code used in IBM is the EBCDIC;uses 8-
bits
 UNICODE:Most popular character encoding standard currently
being used all over the world
 Uses 8- bit or 16 bit
 Unicode provides a unique way to define every character in every
spoken language of the world by assigning it a unique number.

Digital Logic Design Ch1-23


1.8 Binary Storage and Registers
 Registers
 A binary cell is a device that possesses two stable states and is capable of storing
one of the two states.
 A register is a group of binary cells OR a storage location.

 A register with n cells can store any discrete quantity of information that contains n
bits.
n cells 2n possible states
 A binary cell
 Two stable state
 Store one bit of information
 Examples: flip-flop circuits, ferrite cores, capacitor
 A register
 A group of binary cells
 PC in x86 CPU
 Register Transfer
 A transfer of the information stored in one register to another.
 One of the major operations in digital system.
 An example in next slides.

Digital Logic Design Ch1-24


A Digital Computer Example

Memory

Control
CPU unit Datapath

Inputs: Keyboard, Outputs: CRT,


mouse, modem, LCD, modem,
Input/Output speakers
microphone

Digital Logic Design Ch1-25


Transfer of information

Figure 1.1 Transfer of information among register Digital Logic Design Ch1-26
Two elements of a computer system

 To process discrete quantities of information in binary form a


computer must be provided with
 Registers: Devices that hold the data to be processes and
 Digital Logic Circuits :that manipulate individual bits of information

Digital Logic Design Ch1-27


Transfer of information
 Addition of two 10-bit binary
numbers
 Load-store machine
LD R1;
LD R2;
ADD R3, R2, R1;
SD R3;

Figure 1.2 Example of binary information processing Digital Logic Design Ch1-28

You might also like