Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 4, Problem 4.55HW
Program Plan Intro
Processing stages:
- The processing of an instruction has number of operations.
- The operations are organized into particular sequence of stages.
- It attempts to follow a uniform sequence for all instructions.
- The description of stages are shown below:
- Fetch:
- It uses program counter “PC” as memory address to read instruction bytes from memory.
- The 4-bit portions “icode” and “ifun” of specifier byte is extracted from instruction.
- It fetches “valC” that denotes an 8-byte constant.
- It computes “valP” that denotes value of “PC” plus length of fetched instruction.
- Decode:
- The register file is been read with two operands.
- It gives values “valA” and “valB” for operands.
- It reads registers with instruction fields “rA” and “rB”.
- Execute:
- In this stage the ALU either performs required operation or increments and decrements stack pointer.
- The resulting value is termed as “valE”.
- The condition codes are evaluated and destination register is updated based on condition.
- It determines whether branch should be taken or not in a jump instruction.
- Memory:
- The data is been written to memory or read from memory in this stage.
- The value that is read is determined as “valM”.
- Write back:
- The results are been written to register file.
- It can write up to two results.
- PC update:
- The program counter “PC” denotes memory address to read bytes of instruction from memory.
- It is used to set next instruction’s address.
- Fetch:
Combinational circuits and HCL expressions:
- The computational blocks are been constructed by accumulating several logic gates into network.
- The restrictions are been shown below:
- Each of input for logic gate should be connected to any one shown below:
- One of system inputs, that is recognized as primary inputs.
- Output connection for some element in memory.
- Output of some logic gate.
- Outputs obtained from more than two logic gates could not be linked together.
- The wire would be driven to different voltages.
- It can cause malfunction in circuit.
- The network should not have cycles.
- The loops in circuit can cause ambiguity in function
computed by network.
- The loops in circuit can cause ambiguity in function
- Each of input for logic gate should be connected to any one shown below:
- The “HCL” denotes a hardware control language that is used for describing control logic of different processor designs.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
can you please fix the code to resolve the error:Oh no! You've got an error in your assembly code and meet the requirements:
at line 5: expected GETC instruction to have exactly 0 operands, but found 2
.ORIG x3000
; Define constantsBLANK .FILL x0020 ; Blank characterGETC .FILL x20B0 ; GETC trap codePUTS .FILL x22A0 ; PUTS trap codeHALT .FILL x25C0 ; HALT trap code
; Define variablesARRAY .BLKW #20 ; Array to store user inputsN .FILL #0 ; Size of the arrayCOUNT .FILL #0 ; Loop counterINPUT .FILL #0 ; User input
; Prompt messagePROMPT .STRINGZ "Enter a number (0 to 9): "
; Start of program LD R0, N ; Load the size of the array into R0 ADD R0, R0, #-1 ; Subtract 1 from the size to use as a loop counter ADD R0, R0, R0 ; Multiply the loop counter by 2 (each entry is 2 bytes)
LOOP LEA R1, PROMPT ; Load the address of the prompt message into R1 PUTS ; Display the…
Write HCL code for the signal D_stall in the PIPE implementation.Pipeline register D must be set to bubble for a mispredicted branch ora ret instruction. As the analysis in the preceding section shows,however, it should not inject a bubble when there is a load/use hazardin combination with a ret instruction:bool D_bubble =# Mispredicted branch (E_icode == IJXX && !e_Cnd) ||# Stalling at fetch while ret passes through pipeline# but not condition for a load/use hazard!(E_icode in { IMRMOVQ, IPOPQ } && E_dstM in { d_srcA,d_srcB }) && IRET in { D_icode, E_icode, M_icode };
Implement a new unary instruction in place of N0P0 called ASL2 that does two left shifts on the accumulator. V should remain unchanged, but N and Z should correlate with the new value in the accumulator, and C should be the carry from the second shift. Write a program that tests all the features of the new instruction.
Chapter 4 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 4.1 - Prob. 4.1PPCh. 4.1 - Prob. 4.2PPCh. 4.1 - Prob. 4.3PPCh. 4.1 - Prob. 4.4PPCh. 4.1 - Prob. 4.5PPCh. 4.1 - Prob. 4.6PPCh. 4.1 - Prob. 4.7PPCh. 4.1 - Prob. 4.8PPCh. 4.2 - Practice Problem 4.9 (solution page 484) Write an...Ch. 4.2 - Prob. 4.10PP
Ch. 4.2 - Prob. 4.11PPCh. 4.2 - Prob. 4.12PPCh. 4.3 - Prob. 4.13PPCh. 4.3 - Prob. 4.14PPCh. 4.3 - Prob. 4.15PPCh. 4.3 - Prob. 4.16PPCh. 4.3 - Prob. 4.17PPCh. 4.3 - Prob. 4.18PPCh. 4.3 - Prob. 4.19PPCh. 4.3 - Prob. 4.20PPCh. 4.3 - Prob. 4.21PPCh. 4.3 - Prob. 4.22PPCh. 4.3 - Prob. 4.23PPCh. 4.3 - Prob. 4.24PPCh. 4.3 - Prob. 4.25PPCh. 4.3 - Prob. 4.26PPCh. 4.3 - Prob. 4.27PPCh. 4.4 - Prob. 4.28PPCh. 4.4 - Prob. 4.29PPCh. 4.5 - Prob. 4.30PPCh. 4.5 - Prob. 4.31PPCh. 4.5 - Prob. 4.32PPCh. 4.5 - Prob. 4.33PPCh. 4.5 - Prob. 4.34PPCh. 4.5 - Prob. 4.35PPCh. 4.5 - Prob. 4.36PPCh. 4.5 - Prob. 4.37PPCh. 4.5 - Prob. 4.38PPCh. 4.5 - Prob. 4.39PPCh. 4.5 - Prob. 4.40PPCh. 4.5 - Prob. 4.41PPCh. 4.5 - Prob. 4.42PPCh. 4.5 - Prob. 4.43PPCh. 4.5 - Prob. 4.44PPCh. 4 - Prob. 4.45HWCh. 4 - Prob. 4.46HWCh. 4 - Prob. 4.47HWCh. 4 - Prob. 4.48HWCh. 4 - Modify the code you wrote for Problem 4.47 to...Ch. 4 - In Section 3.6.8, we saw that a common way to...Ch. 4 - Prob. 4.51HWCh. 4 - The file seq-full.hcl contains the HCL description...Ch. 4 - Prob. 4.53HWCh. 4 - The file pie=full. hcl contains a copy of the PIPE...Ch. 4 - Prob. 4.55HWCh. 4 - Prob. 4.56HWCh. 4 - Prob. 4.57HWCh. 4 - Our pipelined design is a bit unrealistic in that...Ch. 4 - Prob. 4.59HW
Knowledge Booster
Similar questions
- Can you plese fic this error and and other errors in the code using the LC3 simulator Oh no! You've got an error in your assembly code: at line 5: expected GETC instruction to have exactly 0 operands, but found 2 .ORIG x3000 ; Define constantsBLANK .FILL x0020 ; Blank characterGETC .FILL x20B0 ; GETC trap codePUTS .FILL x22A0 ; PUTS trap codeHALT .FILL x25C0 ; HALT trap code ; Define variablesARRAY .BLKW #20 ; Array to store user inputsN .FILL #0 ; Size of the arrayCOUNT .FILL #0 ; Loop counterINPUT .FILL #0 ; User input ; Prompt messagePROMPT .STRINGZ "Enter a number (0 to 9): " ; Start of program LD R0, N ; Load the size of the array into R0 ADD R0, R0, #-1 ; Subtract 1 from the size to use as a loop counter ADD R0, R0, R0 ; Multiply the loop counter by 2 (each entry is 2 bytes) LOOP LEA R1, PROMPT ; Load the address of the prompt message into R1 PUTS ; Display the prompt…arrow_forwardI need only correct option with explanation. Don't give direct option and wrong answer. I'll give negative mark for wrong answer. Required correct option with explanation. If you don't know don't attempt forward to others..arrow_forwardOur second task is to check the sign bit of a number. There are many ways to do this, but I want the least expensive method in terms of the number of instructions. This generally means avoiding the use of instructions that has immediate operands. To get to the instruction that we need to use, we first need to examine the ALU itself. Which flag (the corresponding ALU tunnel name in parentheses) in the ALU reflects the sign bit of the result of a computation regardless of the computation, with the exception of the instructions dec and inc? S (Sout) only add and subtract instructions affect S (Sout) O (Oout) C (Cout) B (Bout)arrow_forward
- any??arrow_forwardBy changing the return address for the call to echo, we can force the echo function to return to any instruction to continue execution. Below are the instructions of totally_hidden function. If we'd like the echo function to return to the beginning of the totally_hidden function, what value should we change the return address into? assembly code for function totally_hidden: 0x4005fe <+0>: push %rbp 0x4005ff <+1>: mov %rsp,%rbp 0x400602 <+4>: mov $0x4006c8,%edi 0x400607 <+9>: callq 0x4004d0 <puts@plt> 0x40060c <+14>: pop %rbp 0x40060d <+15>: retqarrow_forwardIn C++, the instruction is given in pic. 2nd img contains the expected output. Please explain what your code is as well so I can understand, thank you so much!arrow_forward
- Help pls mcq After execution the short label jump instruction: JMP 84h; (when updated IP =A4h), the new value of IP=00A0h. True Falsearrow_forwardDescribe the implementation of the TestandSet instruction. Show how the followingalgorithm using TestandSet does not satisfy the bounded wait requirement?Shared data: boolean lock = false;Process Pi:do {while (TestAndSet(lock)) ;critical sectionlock = false;remainder section}arrow_forwardBased on the diagram below, what is the result for register AX after executing the mnemonic opcode/operand instructions? MOV AX, 200h MOV BX, 10O0h MUL BX AX BX DX AX CF OF 200h X 100h (X) The resulted AX is 0002. а. The resulted AX is 0000. b. The resulted AX is 1111. Ос. The resulted AX is FFFF. d.arrow_forward
- We wish to execute a single LC-3 instruction that will subtract the decimal number 33 from R1 and put the result in R2. Can we do it? a. No, because the smallest number that fits 5 bits is -32b. No, because we don't have SUB instruction to subtractc. No, because the smallest number that fits 5 bits is -16d. Yes, we can do it with a single instruction.e. none of the above.arrow_forwardC. Why does MIPS not have add label dst, label srcl, label src2, instructions in its ISA (there are at least two reasons for this)? [Read this instruction's function as M[label_dst] = M[label_src1] + M[label_src2].] Provide a concrete technical justification-you should have ideas both from lab and lecture.arrow_forwardWe have a program of 10^6 instructions in the format of “lw,add,lw,add,…”. The add instruction depends only on the lw instruction right before it. The lw instruction also depends only on the add instruction right before it. If this program is executed on the 5-stage MIPS pipeline: a) Without forwarding, what would be the actual CPI? b) With forwarding, what would be the actual CPIarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education