03LogicGates

# d e m o rg a n s t h e o re m logical gates a b or

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ! ) D e M o rg a n ’ s T h e o re m Logical gates A B OR NOT Logical expression Output NOT (A OR B) They both have the same output. A B NOT AND (NOT A) AND (NOT B) Output NOT T h e o r e m : If n e ith e r A n o r B is tr u e , th e n b o th A a n d B m u s t b e fa ls e . C O M P - 1 0 2 : C o m p u te r s a n d C o m p u tin g 19 ( th a n k s to J o e lle P in e a u ! ) How do we choose which expression to implement? • S o m e tim e s fu n c tio n c a n b e m o r e c o m p a c t ( r e c a ll E 1 v s E 2 ) . • M u ltip le lo g ic g a te s ( o f o n e ty p e ) a r e p la c e d o n a s in g le c h ip ; i t m a y b e m o r e e ffic ie n t to u s e a ll o f th e m , r a th e r th a n r e q u ir e a n o th e r c h ip ( o f a d iffe r e n t ty p e ) . 4001 Chip: four 2-input NOR gates C O M P - 1 0 2 : C o m p u te r s a n d C o m p u tin g 20 ( th a n k s to J o e lle P in e a u ! ) L e v e r a g i n g th i s i n s i g h t • Any logical gate can be replaced by a set of NAND gates. • This means all we ever need, to implement any logical expression, is a lot of NAND gates! • Total number of gates may be larger, but total number of chips is usually smaller. (Note: Same thing can be done with NOR gates.) C O M P - 1 0 2 : C o m p u te r s a n d C o m p u tin g 21 ( th a n k s to J o e lle P in e a u ! ) A s l i g h tl y h a r d e r p r o b l e m • Imagine you play a game of Rock-Paper-Scissors against your friend. • Assume you want a computer to automatically decide if you win or not. Each player has choices, and thats make the problem a slightly harder. • What logical variables would you use? • Can you write a logical expression, which evaluates whether or not you win (True = win, False = loose)? E .g . If y o u p la y R o c k a n d y o u r fr ie n d p la y e r s S c is s o r , it r e tu r n s T r u e , a n d s im ila r ly fo r o th e r p o s s ib le p la y s . C O M P - 1 0 2 : C o m p u te r s a n d C o m p u tin g 22 ( th a n k s to J o e lle P in e a u ! ) R o c...
View Full Document

## This document was uploaded on 02/16/2014.

Ask a homework question - tutors are online