0 ratings0% found this document useful (0 votes) 61 views20 pagesCam Scanner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
EROS © kel | Sa
Logic Design
Chapter 1
Digital Systems and Binary
Numbers
Digital Electronics .... EverywhereVN) ae}
Hierarchy in a System
SYSTEM MODULES GATES AND TRANSISTORS.
FLIP-FLOPS
Analog and Digital Signal
x)
, Sampled
7 TT) Quantized
t Lishiiis
Analog signal q 1
i ° Digital
Analog signals v eye igi
8S Oe, Digital signals can assume
continuously over a specific
range with infinite values. only finite values.PSF
Binary Logic Levels
4 TYPICAL VALUES
Yamal 33V 55V
HIGH (1) ¢ noise margin
Vein 20v 4ov ?
FORBIDDEN
y ZONE
tmx. osv 10V
y, LOW (0) | noise margin
tm J oov -o5v?
Number Systems
+ Number Systems?
+ A numeral system (or system of numeration) is a writing
system for expressing numbers; that is, a mathematical
notation for representing numbers of a given set, using
digits or other symbols in a consistent manner.
What are the different forms to represent the number
systems?
— Decimal
— Hexadecimal representation
~ Binary representation
— Arithmetic OperationsEVN (oa
Decimal Number System
+ Deci means 10.
+ Radix or base is equal to 10, e.g. N = 1256.932
Decimal point
t
1256. 932
Integer Fraction
10310210'10° . 10-'10-210-3 weights
——>
<—_
Powers increase by 1. Powers decrease by 1
N = 1x10?+2x10?+5x10'+6x10°+.9x10!+3x10?+2x104
Binary Number System
* Bi=2
* Radix or base is equal to 2
+ Digits 0 & 1aS)
Octal Number System
* Octate =8
« Base / Radix =8
HexaDecimal Number System
+ Hexa=6 & Deci=10
« Base / Radix = 16
+ Digits=0123456789ABCDEFJ ve
PM ™, fe
Commonly Used Number Systems
Name [Decimal] Binary | Octal [Hexadecimal
Radix | 10 2 8 [16
Possible |Oto9 = |Oand1|/0to7/0to9
digit AtoF
values
Number Systems
Quaternary Octal
Decimal Binary
eo ©
#2
0 o
1 1
2 2
3 3
0 4
n 3
2 6
B 7
» 8
9 2 9
0 2 a
u B B
2 30 c
B 3 D
4 32 E
1s x F
16 100 10
” or n
1B 102 2
9 103, BBinary to Decimal Conversion
(111001): = (2)i0
Binary
at 1 1 o o 1
power of 54 4 5 2 q .
abe 2 2 2 2 2
111001, = 1-254+1-24+1-2340-2740-2!41-29 = 57
Conversion to Decimal
* Octal: N = (345),
345 octal = (3 * 82) + (4 * 8!) + (5 * 8°) = (3 * 64) + (4 * 8)
+ (5 * 1) = 229 decimal06 PM OR
Conversion from Decimal
+ Radix Divide Technique: Divide the given integer
successively by the target radix, noting the reminder in
each step, until the quotient is zero. Collect the from each
step starting from last to first.
+ Convert (245)j9 = ()2
2 [2as v7 Remainders
2 [2
[61
[30
15
7
Required 7
base
----o-c-
rerererer)
ofterl
= (IIN0101),
Conversion from Decimal
* Convert: (245)i9 = (Vg
8 [245
8 [30 5
8 3 6
0 3
* Convert: (245) = (is
16 [245
6 [IS s=5
0 IS=Fl = (Fe
—sOka
Conversion from Decimal
+ Radix Multiply Technique: Successively multiply the
given fraction by the required base, noting the integer
portion of the product at each step. Collect the integer
digits starting from first to last.
+ Convert: (0.345)9 = (2 x3
Conversion from Decimal
+ Covert: (242.45) 19= ()2
2 [oar AS
2 [at o x2
2 [oO 1 . 0.90
2 Boo x2
2 Us 0 1.80
2 fi x2
2 Bt 1.60 }
2 O14 x2
Oo 1:20
x2
0.40
x2
0.80
x2
1-60 *repeats
= (1111 0010. 01 TT),ron
(On
Conversion Between Systems
+ From Binary to:
— Octal: arrange bits in groups of 3 and substitute
(10111011001), = (010 111 O11 O01), = (2731),
— Hex: arrange bits in groups of 4 and substitute (10111011001),
=(0101 1101 1001), = (SD9)\¢= (SD9)y
Each single hex digit (4 bits) is called a nibble
— Decimal: use general positional summation method
(10111011001), = 1x2! + Ox2°+ 1x28+ 1x27+
1x26+ 0x25 + 1x24 + 1x23 + Ox2? + Ox2! + 1x2 = (1497) 9
Conversion Between Systems
+ From Octal to:
— Binary: Substitute each Oct digit with 3 binary bits
(1234), = (001 010 011 100),
= Hex: Convert to binary, then to Hex
(1234), = (001 010 011 100),
= (0010 1001 1100), = (29C)ig
— Decimal: use general positional summation method
(1234), = 1x83 + 2x8? + 3x8! + 4x8°
= 1x512 + 2x64 + 3x8 + 4x1 = (668),(oa (ea)
Arithmetic
+ Arithmetic rules in all Number Systems are the same (-, +,
*,/), just remember the base
* Binary Arithmetic:
Binary Addition
4321 0] bit position
01 1/0] carry
10 1/1/0 Note: The carry in the LSB
+0011 position is 0.
TT 1{0[1] sum
Binary Arithmetic
FISISTS13121110] bit position
+ Binary Subtraction:
oo 0
44004011
1
=o1loiiie
+ Binary Multiplication: 01011101 difference
1011 multiplicand
1100 multiplier
multiplier bits
0000 (onl) x 0
Partial 0000 (101) x 0
products 1011 (ont) x 1
101 qoil) x 1
10000100 productrN (ONE)
Representation of Negative Numbers
+ Why do we need a negative representation?
+ Computers do not understand the negative sign.
+ Example: (178)j9 is cavivalent to (10110010),
(e 8
+ Sign-Magnitude system: b,.;by.2 ---... bybp
safe? «roses Pa,
Sign Net magnitude bits
+ Example: ot
-178 - 10110010 is equivalent to 1 10110010
+178 +10110010 is equivalentto 0 10110010
+ If the computer has 9 bits to represent numbers use the
—MSB forthesign
The Complement Number System
+ A complement is a negative representation of a positive
number (and vice versa)
+ The complement of a number (N), defined by:
(N].=r"—(N), if (N), #0
=0 if (N), =0
+ Twos Complement when r = 2 (Binary System)
+ Examples:
- The twos complement of (01010), is
— (01010) = 100000 — 01010 = 10110
+ Complement numbers simplify subtractions
— Subtraction is converted to addition
— Simplifies hardware implementationTwos Complement
+ A shortcut to find the Twos complement:
(01010), =?
10101 a. Complement each bit (i.e., change
each 0 to 1 and 1 to 0).
+1 b. Add 1 to the LSB to get the twos
TOrTO complement.
« Similar to regular binary addition
* Ignore carry out of MSB
Ones Complement
+ Another method to represent negative numbers, same as
‘Two complement but do not add one.
« Example: the ones complement of (01010), is 10101.
Decimal Sign-magnitude Twos complement —_Ones complement
+5 0,0101 0,0101 0,0101
5 1,0101 11011 1,1010,
+4 0,0100 0,0100 0,0100
-4 1,0100 1,1100Negative Representation in Computers
Twos Ones
Decimal complement complemet
+8 ‘01000 01000 ‘1000
” oon oot cont
+6 oon0 ooo oo110
45 oni01 oo101 0101
+4 00100 0100 0100
3 0011 011
2 0010 ooo
ao 00001 0001
+0 0000 on00
=o 10000 ‘00000
1 10001 unit
-2 10010 ino
3 1011 ini01
=a 10100 11100
-5 10101 tout
-6 ion10 hoo
= wont L001
8 11000 11000
Binary Coded Decimal
Computers operate on binary numbers, but when
communicate with humans, they use decimal.
Conversion from binary to decimal and decimal to binary
is necessary.
The digits 0 to 9 are coded into binary bits (this is not
decimal ¢ binary conversion, it is digit coding)
In the BCD code, each decimal digit is represented by 4
bits. The BCD code is the 8,4,2,1 code.
BCD is a weighted code (8, 4, 2, and 1 are weights)
This code is the simplest, most intuitive binary code for
decimal digits and uses the same powers of 2 as a binary
number, but only encodes the first ten values from 0 to 9.BCD Code
* Binary Coded Decimal (BCD)
= Decimal number 86 is
represented in BCD with 8 bits
as 1000 0110, with each group of
4 bits is an input to a seven
segment display.
Binary-Coded Decimal (BCD)
Decimal
‘Symbot
— A decimal number in BCD is :
the same as its equivalent binary 2
number only when the number is 4
between 0 and 9. i tno
- a ; 0
— The binary combinations 1010 : 00
through 1111 are not used. ° v0
Gray Code
+ Continuous or analog information is converted into digital
form by means of an analog-to-digital converter.
+ It is sometimes convenient to use the Gray code to
represent digital data that have been converted from
analog data.
« The advantage of the Gray code over the straight binary
number sequence is that only one bit in the code group
changes in going from one number to the next.Gray Code
+ For example
In going from 7 to 8, the Gray code changes from 0100 to
1100. Only the first bit changes, from 0 to 1; the other three
bits remain the same. By contrast, with binary numbers the
change from 7 to 8 will be from 0111 to 1000, which causes
all four bits to change values.
Gray Code
— Advantage: only one bit is a
changed between any two ‘oon
successive codes 0010
o1i0
ou
101
100
1100
io 9
un 10
ino u
vo10 2
ron 3
t001 4ASCII Code
+ American Standard Ci
26s 000001 m
am NUL ODES P
om son beE TT Qe
mo SIX pC Rt
mx pc 8} Ue
oo cor obcds ST
oor ENG. MAK SEU
ono ACK SYN GO
on MEL ETB 7 G Woe ow
wo BS CAN GX
mo ue uh Fe
won Vr ese Kk
FF Poe ob ov a
ce - Som bm
so SON AR me
st io oe
— 38
ASCII Code
+ ASCII is the abbreviation for American Standard Code
for Information Interchange. Pronounced “askee,”
+ ASCII is a universally accepted alphanumeric code used
in most computers and other electronic equipment.
Most computer keyboards are standardized with the
ASCII.
+ ASCII has 128 characters and symbols represented by
a 7-bit binary code.2s sa)
ASCII Code
+ The first thirty-two ASCII characters are nongraphic
commands that are never printed or displayed and are
used only for control purposes.
Examples of the control characters are “null,” “line
feed,” “start of text,” and “escape.”
The other characters are graphic symbols that can be
printed or displayed and include the letters of — the
alphabet (lowercase and uppercase), the ten decimal
digits, punctuation signs, and other commonly used
symbols.
Other Codes
Decimal BCD
Digit aazt Excess-3
° ‘0000 oon
1 ‘001 100
2 010 o1o1
3 oi! ono
4 0100 on
5 o1o1 1000
6 o10 1001
7 on 1010
8 1000 ion
° 1001 1100
110 oF ‘0000
ior onto 001
i100 ont oo10
11011000 1101
i110 tor m0Error Detection
+ Error-Detecting Code
= To detect errors in data communication and processing, an
eighth bit is sometimes added to the ASCII character to indicate
its parity.
~ A parity bit is an extra bit included with a message to make the
total number of 1's either even or odd.
+ Example: characters with even and odd parity
With even parity With odd parity
ASCII A = 1000001 01000001 11000001
ASCII T = 1010100 11010100 01010100
Warning: Conversion or Coding?
* Do NOT mix up conversion of a decimal number to a
binary number with coding a decimal number with a
BINARY CODE.
* 13,9 = 1101, (This is conversion)
+ 13 <> 0001|0011 (This is coding)NCS
his
BINARY STORAGE AND REGISTERS
The binary information in a digital computer must have a
physical existence in some medium for storing individual
bits.
A binary cell is a device that possesses two stable states
and is capable of storing one bit (0 or 1) of information.
The input to the cell receives excitation signals that set it
to one of the two states.
BINARY STORAGE AND REGISTERS
The output of the cell is a physical quantity that
distinguishes between the two states.
The information stored in a cell is 1 when the cell is in
one stable state and 0 when the cell is in the other stable
state.
+ A register is a group of binary cells.