In certain scientific computations it is necessary to perform the arithmetic operation $(A_i + B_i)(C_i + D_i)$ with a stream of numbers. Specify a pipeline configuraion to carry out this task. List the contents of all registers in the pipeline for i = 1 through 6.
Added by Amanda N.
Close
Step 1
The expression \((A_i + B_i)(C_i + D_i)\) requires two addition operations and one multiplication operation. Show more…
Show all steps
Your feedback will help us improve your experience
Corbin Tegner and 54 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Consider a basic in-order pipeline with bypassing (one instruction in each pipeline stage in any cycle). The pipeline has been extended to handle FP add. Assume the following delays between dependent instructions: - Load feeding any instruction: 3 stall cycles - FP ALU feeding any instruction (except stores): 5 stall cycles - FP ALU feeding store: 4 stall cycles - Int add feeding a branch: 2 stall cycles - Int add feeding any other instruction: 1 stall cycle - A conditional branch has 1 delay slot (an instruction is fetched in the cycle after the branch without knowing the outcome of the branch and is executed to completion) Below is the source code and default assembly code for a loop. Source Code: for (i=1000; i>0; i--) { w[i] = x[i] + y[i] + z[i]; } Assembly Code: Loop: L.D F1, 0(R2) // Get x[i] L.D F2, 0(R3) // Get y[i] L.D F3, 0(R4) // Get z[i] ADD.D F4, F2, F1 // Add two numbers ADD.D F5, F3, F4 // Add the third number S.D F5, 0(R5) // Store the result into w[i] DADDUI R2, R2, #-8 // Decrement R2 DADDUI R3, R3, #-8 // Decrement R3 DADDUI R4, R4, #-8 // Decrement R4 DADDUI R5, R5, #-8 // Decrement R5 BNE R2, R1, Loop // Check if we've reached the end of the loop NOP A) Show the schedule (what instruction issues in what cycle) for the default code. B. How should the compiler order instructions to minimize stalls (without unrolling) (note that the execution of a NOP instruction is effectively a stall)? Show the schedule. How many cycles can you save per iteration, compared to the default schedule? C. How many times must the loop be unrolled to eliminate stall cycles? Show the schedule for the unrolled code.
Akash M.
8) [BB] (10 pts.) Design a circuit that takes in four 4-bit unsigned numbers, A (A3..A0), B (B3..B0), C (C3..C0), and D (D3..D0) and produces the 6-bit unsigned sum of those numbers. You should use three 4-bit adder blocks (74LS283's), and a minimal number of full adders or half adder build blocks. You should organize your adder circuits to perform as many additions in parallel (at the same time) as possible. Getting started: Write out the columns of addition and see where you can apply 4-bit adders. Use half and full adders for remaining addition operations. Block Diagram of Desired Operation: A3 A2 A1 A0 B3 B2 B1 B0 C3 C2 C1 C0 D3 D2 D1 D0 Desired Circuit (S = A[3:0] + B[3:0] + C[3:0] + D[3:0]) S5 S4 S3 S2 S1 S0 a. Which of the two initial set of connections will yield the smallest delay to produce the lower 4-bits of sum (S[3:0]). b. Indicate what should be connected to the carry-in inputs of the 4-bit adders (CX, CY, CZ) for the option you selected. c. Assuming we prefer use of full adders when necessary (rather than using multiple half-adders to mimic a full adder), how many full and half adders would you need?
Adi S.
Assume the following sequence of instructions is executed on a five-stage pipelined datapath: add x5, x10, x5 ld x28, 0(x5) ld x29, 8(x5) add x29, x28, x29 add x6, x10, x11 Assume that the register write is done in the first half of a cycle and register read happens in the second half of a cycle. Draw multiple-clock-cycle pipeline diagrams for the following cases and answer questions: a) If there is no forwarding or hazard detection, insert NOPs to ensure correct execution. b) Schedule the code to avoid as many NOPs as possible if there is no forwarding or hazard detection. What is the code sequence after scheduling? How many NOPs are avoided? c) If forwarding is applied, schedule the code to avoid as many NOPs as possible and show forwarding path using connections between stages.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD