Submit solutions to Expertiza under the names "linker" (part 1) and "circuits" (part 2). Submissions are due by 11:59pm on Monday, March 16.
Submit answers to these exercises to Expertiza in a single text file under the name of "linker".
Here is some C code:int array1[10]; void funct (void) { int array2[10]; array2[3] = array1[3]; }
(The procedure doesn't do anything very interesting.)
Give as specific a description as possible of the code that the C compiler will generate to load register $t0 with array1[3]. (Actual instructions are more specific than pseudocode.)
Give as specific a description as possible of the code that the C compiler will generate to store register $t0 into array2[3].
For each of the code segments in parts a and b, we want to know the earliest stage in the compilation process at which the final numeric values of the fields in all the relevant instructions are known.
Are the numeric fields in the instructions that load $t0 with array1[3] first known ...
Briefly explain.
Are the numeric fields in the instructions that store $t0 into array2[3] first known ...
Briefly explain.
Submit answers to these three exercises to Expertiza in a single text file under the name of "circuits".
Combinational circuits implement boolean functions. There are four boolean functions of one variable. They are shown in the following table.
i | False(i) | Identity(i) | Not(i) | True(i) |
0 | 0 | 0 | 1 | 1 |
1 | 0 | 1 | 0 | 1 |
How many Boolean functions of two variables are there? Make the table. Give names to the functions that you recognize. (Hint: you've seen AND, OR, NOT, XOR so far.)
In lab we have worked with AND, OR, and NOT. This set of Boolean operators is complete in that any Boolean functions can be implemented with a combination of these operators. In fact, there are some very useful operators that are complete all by themselves. One of them is NAND. Its symbol is
And its truth table is
a b a nand b 0 0 1 0 1 1 1 0 1 1 1 0
Show how to build AND, OR, and NOT using only NAND. This constitutes a proof that NAND is complete.
A multiplexor (often referred to as "mux") is an extremely useful circuit. The MIPS CPU has several multiplexors, as we will see in a couple of weeks. A multiplexor takes three inputs, a, b, and s (a selector). The output is a if s is 0 and b if s is 1. It's diagrammed below.
Provide the truth table of a multiplexor, and give a Boolean expression that relates its output to its inputs.
By 11:59pm on Monday, March 16, provide a peer evaluation of classmate homework 6 submissions designated by Expertiza.
Also complete the midsemester survey in an accompanying activity.