Primary contact for this homework: Rebecca Lam rjlam@cs.wisc.edu
You must work in groups of two for this homework. Please write the **full** name (as it appears on Learn@UW) and the student ID of each group member on every page and staple multiple pages together.

###
Problem 1 (2 points)

Convert the following string (only the characters within the quotes) into its ASCII representation: "T4k*". Represent each character in **hexadecimal**. Assume that the string is null terminated.

###
Problem 2 (6 points)

Given the following transistor level circuit:

- (2 points) Fill out the truth table for Z.
- (2 points) Give the equation for Z in terms of A and B.
- (2 points) Draw the
**gate**-level circuit for Z using 2-input AND/OR gates and NOT gates.

###
Problem 3 (4 points)

Given the logic equation Z = (NOT A) OR ( NOT( A AND ( NOT(B) ) ) )

- (2 points) Fill out the truth table for Z.
- (2 points) Draw the
**gate**-level circuit for Z using 2-input AND/OR gates and NOT gates.

###
Problem 4 (6 points)

Given the logic equation Z = NOT( NOT (A AND B) OR ( NOT( B AND A ) ) )

- (2 points) Fill out the truth table for Z
- (2 points) Draw the
**gate**-level circuit for Z using 2-input AND/OR gates and NOT gates.
- (2 points) Draw the
**transistor**-level equivalent of the circuit from part b.

###
Problem 5 (6 points)

Suppose A, B, and C are inputs to logic function Z with the following truth table:

A | B | C | Z |

0 | 0 | 0 | 0 |

0 | 0 | 1 | 1 |

0 | 1 | 0 | 0 |

0 | 1 | 1 | 0 |

1 | 0 | 0 | 0 |

1 | 0 | 1 | 1 |

1 | 1 | 0 | 0 |

1 | 1 | 1 | 1 |

- (4 points) Draw the
**gate**-level circuit using NOT gates and 3-input AND/OR gates.
- (2 points) Convert the circuit of part a into one that uses only NAND gates.
**(Hint: DeMorgan's law)**

###
Problem 6 (6 points)

Assume that A, B, and C are 3 bits that represent an **unsigned** integer, where A is the highest bit and C is the lowest bit (e.g. 3_{10} = 011_{2}=ABC where A=0, B=1, C=1). Suppose A, B, and C are inputs to a logic function that outputs Z = 1 when the number represented by ABC is a prime number **greater than 1.**

- (4 points) Fill out the truth table for Z
- (2 points) Write the logic expression for Z in terms of A, B, and C