You are on page 1of 29

Cairo Faculty of Computers

University and Information

Logic Design
CS221
1st Term 2009-2010

Logic Gates
Administrivia

project and game groups by Tuesday morning

labs and recitations start this week
 download Atanua logic simulator from:
http://atanua.org and bring it with you to the lab
 download lab instructions (from course website)
 form groups of 3 in the lab

project: use Atanua (display, audio, motors)
 design a digital circuit (e.g., simple video game,
talking clock)

how to get an A:
 start early on the project!
 study homework, quiz, and recitation problems
cs221 – sherif khattab
Homework 1

problem 1.33 in book but use 100000010111

due Saturday 24/10 (2 weeks) in lecture
 paper (no soft-copy will be accepted)
 no late

cs221 – sherif khattab


http://www.fci.cu.edu.eg/~skhattab/cs221

cs221 – sherif khattab


decimal codes

4 bits needed

BCD code: binary representation
 64 => 0110 0100

excess-3 code:
 binary value + 3
 self-complementing

64 => 1001 0111

9's complement of 64: 35 (0110 1000) = 1's complement
of 1001 0111

BCD self-complementing?

cs221 – sherif khattab


BCD

25 => 0010 0101 1's complement = 1101 1010


9's of 25 = 99 – 25 = 74 => 0111 0100

excess-3

25 => 0101 1000 1's complement: 1010 0111


9's complement of 25 = 74 => 1010 0111

cs221 – sherif khattab


parity bit

error-detecting code

extra bit
 total number of bits odd or even

 even 1 1110110
 odd 0 1110110

how many errors can be detected with
 odd parity?
 even parity?

cs221 – sherif khattab


binary storage

binary cell
 2 stable states (0 or 1)
 stores 1 bit

register
 group of binary cells
 n cells => n bits
 2n states

1100001111001001
 16-bit integer: 50,121
 ASCII with parity (odd or even?): CI
 4 decimal digits: 9096 (excess-3), BCD?
cs221 – sherif khattab
register transfer

digital system: registers + processing

register transfer:
 transfer of operation between one set to another set
of registers
 direct or through processing circuit

cs221 – sherif khattab


register transfer example

cs221 – sherif khattab


another register transfer example

cs221 – sherif khattab


binary logic

binary variables
 e.g., A, B, x, y, etc.
 two distinct possible values: 1 and 0

basic logical operations
 AND: x∙y = z or xy = z
 OR: x + y = z
 NOT: x' = z or x = z

binary arithmetic: 1 + 1 = ?

binary logic: 1 + 1 = ?

cs221 – sherif khattab


truth table

compact representation of logic operation
definition

cs221 – sherif khattab


logic gates

electronic circuits
 one or more inputs
 one output

processing: passing binary signals through
gates

symbols

binary signal

cs221 – sherif khattab


logic gates (contd.)

timing
diagram

cs221 – sherif khattab


logic gates with multiple inputs

cs221 – sherif khattab


boolean functions

input -> output

binary variables (and constants) and logic
operations

defined by a truth table

for two variables, only 16 boolean functions
possible. why?
 how many possible truth tables?

for n variables, 22n boolean functions

cs221 – sherif khattab


x y f1 f2 f3

0 0 0 1 0
0 1 0 0 1
1 0 0 0 0
1 1 0 0 0

cs221 – sherif khattab


boolean functions (contd.)

cs221 – sherif khattab


logic gates implementation

which functions to implement?
 feasibility and economy
 more than two inputs?
 properties: e.g., commutative (x + y = y + x) and
associative ((x+y)+z = x+(y+z) = x + y + z)

out of the 16:
 2 constants: 1 and 0
 4 repeated: (transfer, complement, inhibition, and
implication)
 inhibition and implication: not commutative nor
associative
 8 remaining
cs221 – sherif khattab
8 logic gates

bubble

cs221 – sherif khattab


8 logic gates (contd.)

cs221 – sherif khattab


exclusive-or gate

cs221 – sherif khattab


positive and negative logic

cs221 – sherif khattab


positive and negative logic

cs221 – sherif khattab


positive and negative logic

cs221 – sherif khattab


Integrated Circuit (IC)

silicon

chip

gates connected to form a circuit

pins

number

data sheets

levels of integration
 SSI: < 10 gates
 MSI: 10 – 1000 (adders, registers)
 LSI: 1000s (memory, processor)
 VLSI: 100,000s (microcomputer; CAD tools; HDL)
cs221 – sherif khattab
digital logic families

circuit technology

basic circuit
 NAND, NOR, or inverter

Examples:
 TTL: transistor-transistor logic (standard)
 ECL: emitter-coupled logic (high speed)
 MOS: metal-oxide semiconductor (high density)
 CMOS: complementary metal-oxide semiconductor
(low power; digital cameras; VLSI)

speed ~ 1/(propagation delay)

cs221 – sherif khattab


computer-aided design

design -> hardware
 ASIC
 FPGA
 PLD
 full-custom

schematic entry (capture)

logic simulator

Hardware Description Language (HDL)
 synthesis tools
 Verilog and VHDL

cs221 – sherif khattab

You might also like