Reference no: EM133510635
Question 1 Suppose a 16-bit processor, with a 16-bit word size. Show the value represented by: 1100 0010 1011 1111 (binary)
in a 16-bit register if it is
(a) 16-bit two's complement signed integer
(b) 16-bit unsigned integer
(c) 8-bit two's complement signed integer
(d) 8-bit unsigned integer
(e) UTF-8
Question 2
Repeat Question 1, supposing the value is in memory in big-endian format.
Question 3
Repeat Question 2(a)-(d), supposing little-endian format.
Question 4
The truth table for a Boolean expression is
Inputs
|
Output
|
x
|
y
|
z
|
0
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
1
|
0
|
1
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
0
|
1
|
0
|
1
|
1
|
0
|
1
|
1
|
1
|
1
|
1
|
(a) Write the Boolean expression sum-of-products form.
(b) Write the Boolean expression's product-of-sums form.
(c) Draw a combinational circuit that implements this truth table.
Note: Write your answer using C notation with | for or, & for and, ~ for not, no white spaces and only the minimal number of parentheses assuming C's order of operations. Order the terms corresponding with the order they appear in the truth table. (Hint: You shouldn't need any parentheses for the sum-of- products form.)
Question 5
Consider the following C source code.
int D[100];
void bar(int x, int y)
{
D[x] = y;
}
int foo(int a)
{
for (int i=0; i < a; i++) { bar(i, i);
}
}
int main(int argc, char *argv[])
{
return foo(10);
}
(a) Translate this code to an assembly language of your choice (RISC-V/MIPS Preferred).
(b) What are the total number of assembly instructions executed? Explain how you found your answer.