Name: Box: Date:

HW1

(5 points) Write the 8-bit 2's complement form of -25.

(5 points) Write the hexadecimal form of 1337.

(10 points) Below is a truth table that implements 3vote. It has inputs A, B, C and output R. Design a digital logic circuit that implements the truth table. You may only use multi-input AND, OR, and NOT gates.

A B C R
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

(15 points) Write a module in Verilog or a program in C that implements 3vote. You should choose types appropriate for the inputs and outputs.