CECS 341 - Midterm
Order of overation five classic components
1. Input data from a keyboard, file, network, etc., is written in memory. 2. A datapath operates on data. 3. Output reads data from memory. 4. Control sends the signals that determine the operations of the datapath, memory, input, and output.
Output device:
A mechanism that conveys the result of a computation to a user, such as a display, or to another computer.
Input device
A mechanism through which the computer is fed information, such as a keyboard
High-level programming language
A portable language such as C, C++, Java, or Visual Basic that is composed of words and algebraic notation that can be translated by a compiler into assembly language.
Assembler
A program that translates a symbolic version of instructions into the binary version.
Procedures arguemnts>..
$a0 - $a3: four argument registers in which to pass parameters $v0 - $v1: two value registers in which to return values $ra: one return address register to return to the point of origin
is $s8 valid
$s7 is the highest-numbered s register.
What are used to return value from procedure?
$vo, and $v1
The operand is at the memory location whose address is the sum of a register and a constant in the instruction.
Base or displacement addressing. Ex: In lw $t0, 32($s3), the memory location to be loaded into $t0 is found by adding register $s3 and constant 32.
A DLL approach better supports library updates.
True
A compiler converts a high-level program, such as a C program, into an assembly language program.
True
An assembler is used to convert an assembly language program to a machine language program.
True
An executable file is a program that can be run on the computer and has no unresolved references.
True
An executable file is executed after a loader places the file into main memory.
True
An instruction at address 985 has a label SUM. The assembler might put the following in a symbol table: SUM: 985
True
An instruction jumps to label SUM. If a symbol table has SUM's address as 985, then the jump will be to address 985.
True
An instruction set architecture enables a machine language program to run on different hardware implementations.
True
Engineering development costs are high and largely independent of volume; thus, the development cost per die is lower with high-volume parts.
True
From the 1970s to 1990s, DRAM capacity has quadrupled every three years.
True
The MIPS add, addi, and sub instructions may result in an exception.
True
The MIPS addu, addiu, and subu instructions may result in an overflow.
True
The agricultural and industrial revolutions each transformed society. Computers have led to a relatively recent information revolution.
True
The improved version of the division hardware halves the width of the adder and divisor.
True
The masks used to make the chip are expensive, so the cost per chip is lower for higher volumes.
True
The refined multiplication hardware halves the width of the Multiplicand register from 64-bits to 32-bits.
True
With high volumes, the manufacturing process can be tuned to a particular design, increasing the yield.
True
Instructions, as well as data, can be stored in memory as numbers.
True.
Upon computing a value to return, the procedure might copy that value into register $v0.
True.
MIPS allows a procedure to modify registers $t0-$t9 without saving those registers to the stack and restoring those registers upon returning.
True. By not requiring the $t registers to be saved/restored, procedures can execute faster, having fewer store/load instructions. However, the caller program must be careful not to expect values in $t registers to be preserved during a procedure call.
The instruction sets of different computers are quite similar to one another.
True. Instruction sets are similar because computers are constructed from hardware technologies based on similar underlying principles, and because all computers must provide several basic operations.
In a two's complement representation, the magnitude of the largest negative value is one greater than the magnitude of the largest positive number.
True. Zero is one of the positive values, leaving one less value available for the other positives. Ex: For an 8-bit two's complement representation, the most negative value is -128 (10000000), while the most positive value is 127 (01111111).
A house architect first designs a house with 5 rooms, then designs room details like closets, windows, and flooring.
Use abstraction to simplify design
Does every byte in memory have a unique address?
Yes
Could the compiler have associated g with $s7, assuming $s7 wasn't used for something else?
Yes. The compiler can use any available register for each variable.
A CPU is also known as _________.
a processor
The CPU chip physically occupies _____ of the size of the iPhone Xs Max.
a small fraction
Which MIPS arithmetic instructions should be generated for byte and halfword arithmetic operations?
add, sub, mult, div
A program to play tic-tac-toe
application software
An integrated circuit is often called a _____.
chip
The manufacturing process begins with a silicon _____.
ingot
personal computer:
is a computer designed for use by an individual, usually incorporating a graphics display, a keyboard, and a mouse.
Embedded computer
is a computer inside another device used for running one predetermined application or collection of software.
Serve
is a computer used for running larger programs for multiple users, often simultaneously, and typically accessed only via a network.
Which MIPS load instructions should be generated for byte and halfword arithmetic operations?
lb, lh
Each step of the multiplication algorithm shifts the Multiplicand register 1 bit to the _____.
left
More registers may benefit an assembly program, but may directly lead to a _____ clock frequency. Type: slower, faster, broken.
slower. More registers may mean the clock frequency must be slowed to ensure the clock signal has time to reach every register, thus slowing every instruction. Hence the principle of "Smaller is faster." Of course, too few registers may mean many more instructions must execute, which is slower, so hardware designers seek a good balance.
What is an overflow?
when the results of an operation are larger than can be represented in a register.
Performs computations.
Datapath The datapath is where data is transformed via computations like addition or subtraction. Control and datapath are commonly together and called a processor.
A wafer tester evaluates the patterned wafer for the presence of _____.
Defects
A drummer's stick breaks, but he quickly grabs another one and continues playing the song.
Dependability via Redundancy
A computer in a cardiac pacemaker, which delivers electric shocks to keep a human's heart beating properly.
Embedded
A customer talks to a phone agent. If there's a problem, he talks to the agent's supervisor.
Hierarchy of Memories
Writes data to memory. Ex: Keyboard.
Input
A college student rents an apartment closer to campus than to her favorite weekend beach spot.
Make the common case fast
Classes of computers
Personal computer, servers and embedded computers.
The jump address is the 26 bits of the instruction concatenated with the upper bits of the PC.
Pseudodirect ddressing
The speedup comes from reducing the size of the registers and ALU.
False
The stack is a region in the set of registers.
False
Very large-scale integrated circuits combine dozens to hundreds of vacuum tubes into a single chip.
False
What is the MIPS assembly language instruction corresponding to the machine instruction with the value 0000 0000hex?
sll
While different hardware implementations may run the same program, designers strive to keep the performance of new hardware implementations the same as older implementations.
False
A home computer kept on a desktop and used by family members for emails, web browsing, social networking, and movie watching.
PC
The branch address is the sum of the PC and a constant in the instruction.
PC-relative addressing
A sister is hanging clothes to dry. Her brother helps by hanging clothes simultaneously.
Performance via Parallelism
A brother is washing and drying dishes. His sister helps by drying each dish immediately after the brother washes each.
Performance via Pipe lining
A mom expects her son will be hungry after a long airplane flight, so she cooks dinner just in case. If he's not hungry, she'll whip up a dessert instead.
Performance via Prediction
The Multiplier register is removed and placed inside of the _____ register.
Product
The stored-program concept means:
Programs are stored in memory along with data Wrong answers: A computer supports a store instruction. Programs are stored on external disks.
If the Remainder is negative, a _____ is shifted into the least significant bit of the Quotient register.
0
What does register $zero equal to
0. It always equals 0
At the end of iteration 2, the 4-bit value of Multiplier is _____.
0000
The initial 8-bit value of Product is _____.
0000 0000
The divide operation results in a 4-bit Quotient of 0011 and an 8-bit Remainder of _____.
0000 0001
At the end of iteration 1, the 8-bit value of Product is _____.
0000 0010
Iteration 1, step 2b restores the Remainder's value to _____.
0000 0111
The initial 8-bit value of Remainder is _____.
0000 0111
At the end of iteration 2, the 8-bit value of Multiplicand is _____.
0000 1000
Consider the 32-bit binary number 11100000 00000000 00000000 00000001, stored in the word with address 5000. For a big-endian architecture, what value is stored in byte 5003?
00000001
At the end of iteration 4, the 4-bit value of Quotient is _____.
0001
The initial 8-bit value of Divisor is _____.
0010 0000
Given the following 32-bit number, what is the most significant bit's value? 1000 0000 0000 0000 0000 0000 0000 0000
1. The leftmost bit is the most significant bit, meaning the bit with the greatest weight. Using the term "most significant bit" versus "leftmost bit" helps prevent confusion if a word is drawn vertically.
Type a mips add instructino that computes z = x + y a = a + b
1. add z, x, y 2. add a, a, b
Iteration 1, step 1 subtracts the Divisor from the Remainder and places the result in the Remainder. The Remainder's updated value is _____.
1110 0111
How many bits are used to indicate that an instruction performs add?
12(the first and last field indicate the operation, in this case add is 6 bits so total 12 bits are used)
What is the largest base ten number representable in 4 bits (assuming the "natural" representation)?
15
The A12 package has a chip containing ____ large ARM processors.
2
An array of words, A, has a base address of 2000. A[0] is thus at address 2000. What is the address of A[1]?
2004. Each byte has an address. So A[0]'s first byte is at 2000, second at 2001, third at 2002, and fourth at 2003. Thus, A[1] starts at 2004.
What is the largest base ten number representable in 8 bits (assuming the "natural" representation)?
255
Each iteration of the division algorithm consists of _____ basic steps.
3
Each iteration of the multiplication algorithm consists of _____ basic steps.
3
Of a word's 32 bits, what is the leftmost bit numbered?
31. The numbering of the rightmost bit starts with 0, so the leftmost bit is numbered with 31 rather than 32.
How many total bits is a machine instruction?
32
In the MIPS architecture, each register is _____ bits wide.
32
The Multiplier register is _____-bits wide.
32
Each word consists of _____ bytes.
4
What is the largest base ten number approximately representable by 32 bits (assuming the "natural" representation)?
4 billion, which is (2^32) -1
The Multiplicand register is _____-bits wide.
64
The Product register is _____-bits wide.
64
Machine language
A binary representation of machine instructions.
Silicon is _____.
A common element found in sand
What is the range of addresses for conditional branches in MIPS (K = 1024)?
Addresses up to about 128K before the branch to about 128K after
Procedure
A stored subroutine that performs a specific task based on the parameters with which it is provided
Assembly language
A symbolic representation of machine instructions
Behind a car's simple items like steering wheel, gas pedal, and brake pedal are complex mechanical/computerized details. Those simple items represent _____.
Abstraction lets users deal with higher-level operations.
Binary Digit
Also called a bit. One of the two numbers in base 2 (0 or 1) that are the components of information
If a procedure will update registers $s0, $s1, $s2, and $s3, the procedure should make room on the stack by adding 16 to $sp.
False. 16 is correct, but the procedure should subtract 16. For historical reasons, the stack grows downwards in memory, from higher to lower addresses.
Computers use binary because binary is more powerful than decimal numbers.
False. Computers use binary because electrical signals can readily be detected as being "on" or "off" (meaning 1 or 0).
What is the range of addresses for jump and jump and link in MIPS (M = 1024K)?
Anywhere within a block of 256M addresses where the PC supplies the upper 4 bits.
An instruction set is a particular program provided in the language of a computer.
False. The instruction set is the language itself, not a particular program. The language is like English, whereas a program is like a particular book written in English.
A procedure should copy all of registers $t0-$t9 and $s0-$s7 to the stack, before executing the procedure's computations.
False. The procedure need only copy registers that the procedure modifies.
When P calls Q, P should expect that Q might pop less from the stack than Q pushed to the stack.
False. Whatever Q pushes, Q should pop. The stack should be the same before and after the call to Q; no larger, no smaller. $sp should be the same before and after the call.
Sends signals that determine the operation of the other components.
Control
A DLL approach results in a larger object program.
False
A DLL approach results in faster-running programs.
False
A compiler and assembler using dynamically linked libraries (DLL) create a complete object program that can be loaded and run.
False
A linker combines independently assembled machine language programs and then recompiles the programs.
False
An assembly language program is a series of 0s and 1s that a machine understands.
False
An object file is output by a compiler, and is a combination of machine language instructions, data, and information needed to place the instructions properly in memory.
False
Computer improvements have led to previously undreamt applications like cell phones, but most signs suggest the improvements are now coming to an end.
False
DRAM capacity today continues to quadruple every three years.
False
High-volume parts always have smaller die sizes than low-volume parts and therefore have higher yield per wafer.
False
In a lazy procedure linkage approach to DLL's, each routine is only loaded if a call to the routine exists in the object program.
False
It is less work to design a high-volume part than a low-volume part.
False
The ALU adds the 64-bit Product and 32-bit Multiplicand, and then stores the result into the Product register.
False
The MIPS addu, addiu, and subu instructions can only operate on unsigned operands.
False
The MIPS addu, addiu, and subu instructions may result in an exception.
False
The computing industry has not improved quite as rapidly as the transportation industry.
False
The improved version of the division hardware does not require a quotient to perform a divide operation.
False
The jal instruction copies registers to the stack.
False
The physical machinery on which software runs.
Hardware
The operand is a constant within the instruction itself.
Immediate addressing
Stores instructions and data.
Memory
Dynamic random access memory (DRAM):
Memory built as an integrated circuit; it provides random access to any location. Access times are 50 nanoseconds and cost per gigabyte in 2020 was $3 to $6.
Assuming $s3 has 5000, is the following an acceptable instruction? lw $t0, 3($s3)
No. w is a load word instruction, so the computed address must be a valid word address. Word addresses are multiples of 4, so 3 + 5000, or 5003, is not a valid word address. A different instruction exists to load a particular byte.
Software that manages hardware resources on behalf of other programs.
Operating System
Reads data from memory. Ex: Display.
Output
What are lead procedures?
Procedures that do not call others
The operand is a register.
Register addressing
A computer at a federal laboratory that continually executes sophisticated algorithms on massive amounts of data from various weather stations to develop accurate weather forecasts.
Server
A computer in an Amazon building accessed by thousands of people for online shopping.
Server
The collection of software on a computer that provides services to application software.
Systems software
Control
The component of the processor that commands the datapath, memory, and I/O devices according to the instructions of the program.
Datapath:
The component of the processor that performs arithmetic operations.
In two's complement, is the following number positive or negative? 1111 0000 0000 0000 0000 0000 0000 0000
The leftmost bit is the sign bit. The 1 means negative.
Which MIPS store instructions should be generated for byte and halfword arithmetic operations?
sb, sh
Memory
The storage area in which programs are kept when they are running and that contains the data needed by the running programs.
Where are data structures, such as array and struct kept..
They are kept in memory, as they are virtually impossible to keep in registers.
Goal: Force the rightmost bit of $s3 to be 1. _____ $s3, $s3, 1
ori
After the patterned wafer is chopped up into dies, the dies are _____.
packaged
1000^5 bytes is a _____byte
peta
In the instruction below, a, b, and c are operands. In such an arithmetic instruction, each operand comes from special hardware called a _____.
register
Each step of the division algorithm shifts the Divisor register 1 bit to the _____.
right
Each step of the multiplication algorithm shifts the Multiplier register 1 bit to the _____.
right
register $at is reserved
the assembler to handle large constants.
If the Remainder is negative, then the original Remainder value is restored by adding _____ to the Remainder.
the divisor
Blank wafers undergo 20 to 40 chemical processing steps to create _____.
transistors, conductors, and insulators
A terabyte is one _____ bytes.
trillion