28.06.2014 Views

Chapter 5: Architecture - Computer and Information Science - CUNY

Chapter 5: Architecture - Computer and Information Science - CUNY

Chapter 5: Architecture - Computer and Information Science - CUNY

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.2. CLASSICAL GATES 15<br />

A is a 2 m by 2 n matrix. B is a 2 m−p by 2 q matrix. Since nothing should be<br />

done to the m − p bits, we might represent this as the 2 m−p by 2 m−p identity<br />

matrix I m−p . We do not draw any gate for the identity matrix. The entire<br />

circuit can be represented by the following matrix<br />

Example 5.2.2 Consider the circuit<br />

(B ⊗ I m−p ) ⋆ A. (5.47)<br />

This is represented by<br />

OR ⋆ (NOT ⊗ AND). (5.48)<br />

Let us see how the operations look like as matrices. Calculating, we get:<br />

⎡<br />

⎤<br />

0 0 0 0 1 1 1 0<br />

⎡ ⎤ ⎡ ⎤<br />

NOT ⊗ AND = ⎣ 0 1 ⎦ ⊗ ⎣ 1 1 1 0<br />

0 0 0 0 0 0 0 1<br />

⎦ =<br />

.<br />

1 0 0 0 0 1 ⎢<br />

⎣<br />

1 1 1 0 0 0 0 0⎥<br />

⎦<br />

0 0 0 1 0 0 0 0<br />

(5.49)<br />

And so we get<br />

⎡<br />

OR ⋆ (NOT ⊗ AND) = ⎣ 0 0 0 0 1 1 1 ⎤<br />

0 ⎦ . (5.50)<br />

1 1 1 1 0 0 0 1<br />

Let us see if we can formulate DeMorgan’s laws in terms of matrices. One<br />

of DeMorgan’s law states that ¬(¬P ∧ ¬Q) = P ∨ Q. In pictures this looks like<br />

In terms of matrices this corresponds to<br />

NOT ⋆ AND ⋆ (NOT ⊗ NOT) = OR. (5.51)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!