PA2 key ----------------------------------------------------------------------- 1) How many test cases are necessary to test each of the below functions fully? How did you determine your answer? BIT and_gate( BIT A, BIT B ) 4 BIT not_gate( BIT A ) 4 BIT rs_latch(BIT S, BIT R) 8 BIT or_gate( BIT A, BIT B ) 4 BIT2 adder_full(BIT a, BIT b, BIT carry_i) 8 BIT4 adder_4bit(BIT4 A, BIT4 B) 2^8 = 256 BIT d_latch(BIT WE, BIT D) 8 To determine the number of tests, we take the multiply the number of possible values for each external input by the number of possible values for all other inputs including internal inputs (i.e. functions that have a static variable or call functions with static variables). ----------------------------------------------------------------------- 2) Powers of two. Fill in the missing information in the following chart: Power of two Abbreviation Term ----------------------------------------- 2^10 1 K 1 kilo 2^20 1 M 1 mega 2^30 1 G 1 giga 2^40 1 T 1 tera 2^50 1 P 1 peta 2^60 1 E 1 exa 2^70 1 Z 1 zetta 2^80 1 Y 1 yotta 2^11 2 K 2 kilo 2^32 4 G 4 giga 2^27 128 M 128 mega 2^17 128 K 128 kilo ----------------------------------------- ----------------------------------------------------------------------- 3) (DRAWING) Question 3.16 in the book. This will be turned in separately. Michelle will grade this part. ----------------------------------------------------------------------- 4) (DRAWING) Draw a diagram similar to the one in Figure 3.21 but for a 2^3-by-2 bit memory. This will be turned in separately. Michelle will grade this part. ----------------------------------------------------------------------- 5) How many bits does a 2^3-by-2 bit memory contain? 8*2 bits = 16 bits ----------------------------------------------------------------------- 6) Given a 2^n-by-m-bit memory how many and what size decoders and muxes are needed? 1 decoder with n bits of input and 2^n bits of output m muxes, each with 2^n select inputs and 2^n inputs and 1 output A typical mux only needs n select inputs, but the muxes in memory can use the outputs from the decoders as select lines. ----------------------------------------------------------------------- 7) Write an equation to describe the number of bits that a 2^n-by-m-bit memory contains. (num bits) = 2^n * m ----------------------------------------------------------------------- 8) Fill in the missing pieces of the truth table for the combinational circuit that will control the next state and output for the 2-bit saturation counter. Current Input Next State JUMP State OUT ------------------------------------------------------------ 0 B1=0,B0=0 0 0 B1=0,B0=0 0 (no jump) 0 B1=0,B0=0 1 1 B1=0,B0=1 0 (no jump) 1 B1=0,B0=1 0 0 B1=0,B0=0 0 (no jump) 1 B1=0,B0=1 1 2 B1=1,B0=0 1 (jump) 2 B1=1,B0=0 0 1 B1=0,B0=1 0 (no jump) 2 B1=1,B0=0 1 3 B1=1,B0=1 1 (jump) 3 B1=1,B0=1 0 2 B1=1,B0=0 1 (jump) 3 B1=1,B0=1 1 3 B1=1,B0=1 1 (jump) ----------------------------------------------------------------------- 8) (DRAWING) Draw three separate combinational circuits that take the current values of B1, B0, and JUMP as input and generate the next values of B1, B0, and OUT respectively. Include the above truth table with your drawing. This will be turned in separately. Michelle will grade this part.