t r u th ta b l e write up a table with all possible

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e lle P in e a u ! ) T r u th ta b l e • Write-up a table with all possible input combinations, and check the output the output for each row. Inputs: Outputs: V1 V3 0 0 0 0 1 1 1 1 • V2 0 0 1 1 0 0 1 1 ACTIVITY 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 This is called a Truth Table. 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 5 ( th a n k s to J o e lle P in e a u ! ) C o m p a rin g lo g ic a l e x p re s s io n s • Recall our previous expression: ACTIVITY = (V1 AND V2) OR (V1 AND V3) OR (V2 AND V3) • You can also extract the logical expression directly from the Truth Table: ACTIVITY = ( (NOT V1) AND V2 AND V3) OR (V1 AND (NOT V2) AND V3) OR (V1 AND V2 AND (NOT V3)) OR (V1 AND V2 AND V3) 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 6 ( th a n k s to J o e lle P in e a u ! ) Extracting logical expression from the truth table • Recall: ACTIVITY = ( (NOT V1) AND V2 AND V3) OR (V1 AND (NOT V2) AND V3) OR (V1 AND V2 AND (NOT V3)) OR (V1 AND V2 AND V3) • How do we get this logical expression: – Consider each line in the table. • If th e lin e h a s O U T P U T = 1 , th is lin e m u s t b e in c lu d e d in th e lo g ic a l e x p r e s s io n a s a s u b - e x p r e s s io n . • T h e s u b - e x p r e s s io n in c lu d e s a ll v a r ia b le s , w h e r e t r u e v a r ia b le s a r e in c lu d e d w ith o u t m o d ific a tio n a n d n e g a tiv e v a r ia b le s a r e p r e c e d e d b y N O T o p e r a to r . • T h e v a r ia b le s in a s u b - e x p r e s s io n a r e s e p a r a te d b y “ A N D ” lo g ic a l o p e r a to r s . – Sub-expressions are separated by “OR” logical operators. – This is a “disjunction” of “conjunctions”. 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 7 ( th a n k s to J o e lle P in e a u ! ) P r o s / c o n s o f th e tw o l o g i c a l e x p r e s s i o n s • Compare: E1: ACTIVITY = (V1 AND V2) OR (V1 AND V3) OR (V2 AND V3) E2: ACTIVITY = ( (NOT V1) AND V2 AND V3) OR (V1 AND (NOT V2) AND V3) OR (V1 AND V2 AND (NOT V...
View Full Document

This document was uploaded on 02/16/2014.

Ask a homework question - tutors are online