Computer Architecture study guide 2020

¡Supera tus tareas y exámenes ahora con Quizwiz!

A

Another difficulty of creating the memory chip is determining if the memory address is specifying the screen. We know that the screen begins at 16,384 and ends at 24,575. What are their hex and binary equivalents? A. 0x4000 = 0100 0000 0000 0000, 0x5FFF = 0101 1111 1111 1111 B. 0x4000 = 0100 0000 0000 0000, 0x6000 = 0110 0000 0000 0000 C. 0x3FFF = 0011 1111 1111 1111, 0x5FFF = 0101 1111 1111 1111 D. 0x4000 = 1000 0000 0000 0000, 0x5FFF = 0111 1111 1111 1111

NOT

BAR OVER X

C

What will be the binary of the 4th line of the binary (.hack) file? A. 0000000000000001 B. 000000000000001 C. 1111010011010000 D. 0000000000000010 E. 1111110000010000

E

What will be the binary of the 6th line of the binary (.hack) file? A. 1110001101000001 B. 1110001100000010 C. 1110001100000101 D. 0000000000001010 E. 1110001100000001

A

What will be the binary of the 9th line of the binary (.hack) file? A. 0000000000001100 B. 0000000000001101 C. 0000000000001011 D. 0000000000010000 E. 1110101010000111

C

Which is the correct output for a half-adder given inputs of 0 and 1? A. sum = 1, carry =1 B. sum = 0, carry =0 C. sum = 1, carry =0 D. sum = 0, carry =1

D

Which of the following Python data structures is most appropriate for managing a symbol table? A. array B. tuple C. string D. dictionary E. list

E

Which of the following can not be preformed in a single ALU operation? Assume A and D are both zero to begin. A. jump to ROM address 0 B. set the D register to the value of the A register plus 1 C. set R0 to 1 D. set R0 to 0 E. set R0 to 25

F

Which of the following is not part of the Hack computer? A. Memory for Intructions B. CPU C. Memory for Storage D. Keyboard E. Screen F. Disk Storage

B

Which of the following is the address of the last 16 bit word in screen? A. 16384 B. 24575 C. 24384 D. 24576

C

Which of the following lines of HDL will successfully identify an instruction as an A-instruction (true if A instruction)? A. Not(in=instruction[12],out=aInst); B. Or(a=instruction[15],b=false, out=aInstr); C. Not (in=instruction[15], out=aInst); D. And(a=true,b=instruction[15], out = aInstr);

A

execute to start simulator in Linux/OSX A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

F

execute to start simulator on Windows A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

D

file containing the chip's specification A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

B

A 16-bit instruction with the leftmost bit set to 0 (e.g. 0xxx xxxx xxxx xxxx) is what kind of instruction? A. C-instruction B. A-instruction C. Destination instruction D. Jump instruction

D

A chip is being developed that has 3 input bits and 1 output bit. How many different boolean functions could this chip compute? A. 8 B. 128 C. 255 D. 256 E. 512

A

A difficulty arises in coding the HDL for the Memory chip. The keyboard address is 0x6000 = 0110 0000 0000 0000. To devise a test to see if a memory address is this value, one should: A. See if bits 14 and 13 are 1, and check that bits 0..12 are 0. B. Just check if bits 13 and 14 are 1. C. Just check that bits 0..12 are 0. D. See if the And of bits 13 and 14 is 1. E. See if the 8 Way Or of bits 0..7 Or the 8 Way Or of bits 5..12 is 1.

B

Consider a demultiplexor. What should the output be if the input is 1 and the sel line is 1? A. a = 1, b = 0 B. a = 0, b = 1 C. a = 1, b = 1 D. a = 0, b = 0

A

Consider a multiplexor. If the inputs are sel = 1, a = 1, b = 0, then the output should always be what? A. 0 B. 1 C. AND(a,sel) D. a E. OR(b,sel)

D

Consider the RAM8 chip you need to write. The output should be the contents of the register specified by the address line. Select the best chip for doing that. A. DMux B. DMux8Way C. ALU D. Mux8Way16 E. Mux4Way16

D

Consider the following Hack machine language commands: @20 D = A @R12 DM = A + M What is in the memory cell labeled R12 after this sequence is executed? A. 20 B. Whatever was in R12 before it was executed. C. Whatever was in R12 before it was executed, plus 20. D. Whatever was in R12 before it was executed, plus 12. E. The contents of memory cell 20 plus R12.

B

For a RAM that holds 256 kilobytes of 64 bit words, the load line has to be how many bits? A. 18 B. 1 C. 12 D. 8 E. 32 F. 16 G. 6

E

For a RAM that holds 256 kilowords of 64 bit words, the address line has to be how many bits? A. 1 B. 6 C. 8 D. 12 E. 18 F. 16 G. 20

A

Given that line is a string variable representing a "C-command" that has been stripped of spaces, which of the following is the best strategy to break it into dest, comp, jump portions? A. use line.split(x) where x will be "=" or ";" to break the line into its parts. Get the output list, check it's length, and subdivide it if needed. B. use line.find(x) where x will be "=" or ";" to break the line into its parts. Get the output integer, and use it to find the appropriate sub-string. C. write a loop "for character in line:" and assemble the dest, comp, and jump components in nested loops. D. use line.find(x) repeatedly, where x is M, D, A, and J and use these positions as the begging or end of dest, comp, and jump portions.

In registers

How are numbers stored on the CPU we will develop?

2^(2^n)

How many boolean functions can be attributed to n input bits?

B

How many entries will be in the symbol table prior to reading the first line of code? A. 0 B. 23 C. 16 D. 18 E. None of these

2^n (2 to the nth power)

How many inputs are possible in a boolean function that accepts n bits?

C

How many lines will be in the output binary file? A. 27 B. 25 C. 16 D. 18 E. 26 F. 19

A

In Chapter 6 notes, slide 56 there are only has 18 rows in the comp table. Why might you need more entries in the dictionary you use to represent the comp table? A. There are the 10 extra M vs. A instructions, and we should probably put the extra entries into the symbol table to account for reversible commands (otherwise we have to mess around in parsing). B. We have to account for the possibility that the assembly code is A+D instead of D+A, so duplicates of reversible entries are present. C. The 'a' bit in an C-instruction causes the A to be an M. Those produce 10 extra instructions to account for. D. The table on slide 56 is trash, the correct table is the one on slide 55. E. The symbol table for comp should also have the memory symbols for R0-R9 in it.

A

In a 1-bit storage unit you have two inputs, load and in. There is one output, out. If not load(t-1) then: A. out(t) = out(t-1) B. out(t) = in(t) C. out(t) = load(t) D. out(t) = load(t) E. out(t) = in(t-1)

C

In binary, what is 010111 plus 2? Hint - add 1 twice. A. 011000 B. 010110 C. 011001 D. 011010

A

In the book's HDL, which of the following will give the first 8 bits of the variable a? A. a[0..7] B. a[0-7] C. a[0..8] D. a[0...8] E. a[8-15]

Virtual machine instructions

In the programming model of the textbook, what is the result of compiling Jack code?

B

In this class, all chapters can be done assuming the previous chapter results are completed and implementation details are no longer needed. For example, you only needed to know the inputs and outputs of the ALU in order to create a CPU. You didn't know that the ALU needed an AND16, or several Multiplexors. What is this powerful way of designing systems often called? A. Data driven design B. Abstraction C. Top down design D. Agile development E. Test driven development

D

In this course, all chips are made by assuming that one gate is given. Assume that the inputs to the gate are as follows: a b 0 0 0 1 1 0 1 1 What are the corresponding outputs of the one gate that is given in this class? A. 0000 B. 0001 C. 0110 D. 1110 E. 0111

B

In this course, all chips are made by assuming that one gate is given. What single gate is that? A. Nor B. Nand C. Xor D. Or E. And

E

In twos compliment, what is the value of not(0), irrespective of the number of bits? A. 0 B. 1 C.2 D. -2 E. -1 F. None of the above

A

Let's suppose that you'd like a chip that outputs the input x (msb in this case). Select the way or ways to do that below. Assume 'true' is always true and 'false' is always false. A. true AND x B. Xor(x,true) C. true + x D. true + x (true + x) E. false x (false AND x)

E

RAM chips are implemented with a DMux8Way in them. What is the purpose having the DMux8Way in RAM? A. To determine if the memory cell specified by the address is added to or overwritten by the input. B. To select the memory cell that is output. C. To chose the relevant portions of the input address. D. To reset the input, if the reset bit is asserted. E. To select the memory cell that is written to if load is true.

D

SCREEN BEGINS AND ENDS 0x4000 = 0100 0000 0000 0000, 0x5FFF = 0101 1111 1111 1111 your test to see if an address goes to the screen and not the keyboard or RAM should be based on address bits (remember, the right most bit is bit 0): A. 15 only B. 14 only C. 15 and 14 D. 14 and 13 E. 13 and 12

B

Set register A to the memory cell M[A] A. M=D B. A=M C. D=A-1 D. D=M-1 E. AM = @17

C

Set register D to register A minus 1 A. M=D B. A=M C. D=A-1 D. D=M-1 E. AM = @17

D

Set the contents of register D to the value of the memory cell M[A] minus 1 A. M=D B. A=M C. D=A-1 D. D=M-1 E. AM = @17

A

Set the contents of the memory cell M[A] to register D A. M=D B. A=M C. D=A-1 D. D=M-1 E. AM = @17

E

Set the value of register A and the memory cell M[A] to 17. A. M=D B. A=M C. D=A-1 D. D=M-1 E. AM = @17

D

Study the following circuit. Use the final page of this exam as a reference if you do not recall the graphical representation of fundamental gates. Circle the choice that describes the function of this set of more primitive gates. A. Full-Adder B. If C. And D. Xor E. De-multiplexor

C

Suppose that you are designing a multi-way multiplexor with 4 inputs. Then, selecting the correct output requires 2 select bits. In HDL, which is the syntactically correct way to specify the first (most significant or left most) bit in a two bit input called sel? A. sel{1} B. sel(1) C. sel[1] D. sel(0) E. sel{0} F. sel[0]

A

Suppose you have a 16 bit input called 'b' for a chip you are building. The chip adds one to a value, and is called Inc16. You'd like that input to always be (decimal) 1. Which of the following statements achieves that in HDL? In the array, the lowest index corresponds to the least significant bit. A. b[0] = true, b[1..15]=false B. b[15] = true,b[0..14]=false C. b[1] = true, b[2...16]=false D. b[1] = false, b[2..16]=true

A

Suppose you want a screen pattern of alternating black and white pixels across each row. The first (left) pixel should be black. What unsigned 16 bit number does should be written to the screen's memory locations? Use a binary to decimal converter. LSB is leftmost! A. 43690 B. 10922 C. 54613 D. 21845

C

Supposing the inputs to a boolean function are x and y. Write the inputs in such a way that the least significant bit is x and y is most significant. What is the output of x+not(y), also called "if y then x"? A. 1011 B. 1110 C. 1101 D. 1100 E. 1001

A

The ALU has a zr flag to determine if the output is all zeros. Which of the following gates will be indispensable in finding zr? A. Or8Way B. DMux8Way C. HalfAdder D. And16 E. Or16

B

The C-Instruction has what format? A. dest = jump;comp B. dest = comp;jump C. dest = jump, comp; D. dest = comp, jump;

B

The all important 'bit' (storage) is a multiplexor with a DFF. Its logic is: if load(t-1) then out(t) = in(X) else out(t) = Y(t-1). What are the correct values of X and Y in this logic? A. X = t, Y = out B. X = t-1, Y= out C. X = t-1, Y = in D. X = t, Y = in

C

The boolean expression not(x)y+xnot(y) is equivalent to which of the following?A. xy+xnot(y)B. AND(x,y)C. XOR(x,y)D. NAND(x,y)E. xnot(y)

E

What will be the binary of the 15th line of the binary (.hack) file? A. 1110101010000111 B. 1110101000000111 C. 1110101010000110 D. 0000000000001111 E. 0000000000001110

A

The f bit of the ALU controls the operation performed on the processed inputs x and y. The operation is either AND16 or binary addition, ADD16. Which of the following is the best strategy to completing the logic with basic gates? A. Compute both AND16(x,y) as well as ADD16(x,y) and use a MUX16 to determine which advances to the next stage. B. Compute ADD16(x,y) and find basic gates to convert that result to AND16(x,y) if and only if f=1. C. Compute AND16(x,y) and find basic gates that result to ADD16(x,y) if and only if f = 1. D. Use basic gates to transform f into 16 bits that when combined with x and y give the correct output.

B

To find the twos compliment of a binary number, you should: A. flip all the bits B. flip all the bits and then add one C. add one and then flip all the bits D. flip all the bits and then add two E. add two and then flip all the bits

C

What does the following Hack machine language code block do? A. If D=100 go to 7, else goto 150 B. If D=100 goto 150, else goto 0 C. If D=0 goto 100, else goto 150 D. If D=0 goto 150, else goto 0

B

What is NOT(NOT(X)-1)? The + operator below is addition. - is subtraction. A. NOT(X) B. X+1 C. NOT(X) - 1 D. X E. None of the above

A

What is the canonical representation of the function given on 3 input variables that results in 01010111? Assume labels for input variables are x (most significant bit), y, and z (least significant bit).A. not(xy)z+not(x)yz+xnot(y)z+xynot(z)+xyz B. not(xy)z+not(x)yz+xnot(y)z+xynot(z)+not(xy)z C. not(xyz)+not(x)yz+xnot(y)z+xynot(z)+xyz D. not(x)yz+xynot(z)+xnot(y)z+not(x)yz+xyz E. None of these.

A

What is the correct binary structure of a C-instruction?

A

What is the decimal equivalent of the binary number 0101 1011? Do not use a calculator! A. 91 B. 59 C. 155 D. 75 E. 87

B

What is the decimal result of the binary addition of 5 and the 8-bit number 0110 0111? A. 110 B. 108 C. 103 D. 106 E. 104

B

What is the largest unsigned number that can be represented in an A-instruction? A. 2^( 14 - 1) B. 2 ^(15 - 1) C. 2 ^15 D. 2 ^(16 - 1 ) E. 2 ^16

A

What is the result of taking the twos compliment representation of negative 1 AND x? Assume x is some 16 bit binary number in twos compliment form? A. x B. NOT(x) C. -1 D. 1 E. None of the above

D

What is the sum of the binary numbers 1101 + 0111? Include any overflow bit or bits in your answer. A. 00100 B. 0100 C. 0101 D. 10100

Abstraction

What is the term applied to the powerful idea that one need not know the implementation details, only the function of a portion of a computing system?

Only addressing registers.

What kind of addressing? AND registers 1 and 3. _____________ Addressing

Immediate

What kind of addressing? Set register R1 to be the constant 12. _____________ Addressing

Direct

What kind of addressing? Set register R2 to be the contents of memory cell 55. _____________ Addressing

Indirect

What kind of addressing? Set the value of R3 to be M[M[R1]], the memory address specified in R1. _____________ Addressing

Direct

What kind of addressing? Set the value of R4 to M[sp], the value of memory cell of sp _____________ Addressing

D

Which of the following lines of HDL will test to see if a ALU result is positive. Assume outputs from the ALU are aluZr and aluNg of zero and negative respectively. Also assume that a ';' indicates a new line. A. Or (a=aluZr, b=aluNg, out=zrng); And (a=zrng, b = aluNg, out=aluPos); B. Or (a=aluZr, b=aluNg, out=zrng); Or (a=zrng, b = aluNg, out=aluPos); C. And (a=aluZr, b=aluNg, out=zrng); Not (in=zrng, out=aluPos); D. Or (a=aluZr, b=aluNg, out=zrng); Not (in=zrng, out=aluPos);

B

Which of the following machine language commands sets x to a value corresponding to the location of the next free memory cell? A. A=x B. @x C. D=x D. (x) E. x=M

D

Which of the following machine language commands sets y to be a value equal to the line number or address in instruction code? A. A=y B. y;jmp C. @y;jmp D. (y) E. y F. @y

B

Which of the following machine language commands will advance the screen pointer to the next position for writing to the screen. ";" is new line. A. @SCREEN_COUNTER; D = A; A = A + 1; M = A B. @SCREEN_COUNTER; M = M + 1 C. @SCREEN_COUNTER; A = A + 1 D. @SCREEN_COUNTER;M = A + 1 E. @SCREEN_COUNTER; D = A; D = M + 1; A = D; M = A

D

Which of the following machine language commands will color the set of 16 pixels all black? SCREEN_COUNTER stores the memory mapped address of the current screen word. ";" here is used to indicate new line. A. @SCREEN_COUNTER; A = M; M = -1 B. @SCREEN_COUNTER; D = A; M = -1 C. @SCREEN_COUNTER; M = 1 D. @SCREEN_COUNTER; D = M; A = D; M = 0

A

Which of the following proves that And, Or, and Not gates are sufficient to express all boolean functions? A. The way that we arrive at the canonical form for a truth table, which involves writing each one in the outputs as a combination of And and Not, and then combining all outputs of one with Or. B. That Or is more frequently true than And. C. This proof is more complex than any of the provided answers. D. The fact that x+y, xy, and not(x) have truth tables that are all different. E. That Not can always be reversed with Not Not.

D

Which of the following proves that you don't really need Or, and can express all boolean functions with just And and Not. A. x + y = Xor(x,y) + xy B. x + y = Not(xy) C. x + y = Nand(x,y)Not(xy) D. x + y = Not(Not(x)Not(y))

C

Which of the following python commands will remove all spaces from a line of text stored in the variable line? A. line.strip() B. line[line.find(" "):] C. line.replace(" ", "") D. line.substitute(" ","") E. line.replace("\s","")

D

Which of the following represents the integer -11 in twos compliment with 8 bits? A. 1110 0101 B. 1110 1101 C. 1111 1110 D. 1111 0101 E. 1111 1001

B

Which of the following twos complement representations of a number, when added to 9, results in 0? A. 1111 1110 B. 1111 0111 C. 0000 1001 D. 1111 0110 E. 1111 1001

C

Which of the following will jump to a line of code labeled "(BLACKEN)" if a key is pressed? In this problem "<nl>" is new line. A. @BLACKEN<nl>@KBD<nl> A;JNE B. @KBD<nl>M;JNE C. @KBD<nl>D=M<nl>@BLACKEN<nl>D;JNE D. @KBD<nl>D=A<nl>@BLACKEN<nl>D;JNE E. @KBD<nl>D = M<nl>@24576<nl>D=D-M<nl>D;JEQ

A

Which parts of a C-instruction are optional? A. dest, jump B. dest, comp C. jump, comp D. dest E. jump F. comp

AND

XY

C

You are given the input of 4 and you need to flip the sign. What is the output to represent -4 in two's complement? A. 1010 B. 1001 C. 1100 D. 1110 E. 1011

B

script for testing a chip A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

E

the expected output of a chip A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

C

the output of the chip in the .hdl file A. .sh B. .tst C. .out D. .hdl E. .cmp F. .bat

OR

x+y


Conjuntos de estudio relacionados

Macroeconomics Exam II (HW Drills)

View Set

CH. 7 & 8 ACCT 2110 Miller Exam 3

View Set

Componentes orgánicos de la materia viva

View Set

ch.24 Pituitary and Thyroid Disorders

View Set

BIO311: Ch 14 Gene Regulation in Bacteria

View Set

Conjunctions of contrast - despite, inspite of, although, though

View Set