Question: a) FLOW CHART b) c. Custom Problem #2: Integer Division: From the slide titled Enhanced Processor w/PC Tester Circuit from the lecture segment titled Programming

a) FLOW CHART
b) 
c. 
Custom Problem #2: Integer Division: From the slide titled "Enhanced Processor w/PC Tester Circuit" from the lecture segment titled Programming a CPU with Machine Language - The Execution, implement the following division algorithm: C = 0; do { A = A-B; C = C + 1; } while (A >= 0); C = C-1; NOTE: this algorithm uses a "do-while loop. It is slightly different than a normal while loop. The computer will always go through the loop once, and then check the condition before it performs it again. This differs from a while loop that will only perform the loop IF the condition is first met. a) Show a Flow Chart, like the one shown in the previous segment, Programming a CPU with Machine Language - The Setup, this will help you break the program into its various "states." b) Show a table like the one shown on the slide titled Multiply Algorithm: Control Memory Contents from the lecture segment Programming a CPU with Machine Language - The Execution, listing the values of the control signals necessary to implement the algorithm above. You may assign registers any way you like to hold your variables and necessary data, but state it up front! c) Show an Execution Trace (like the one shown in the same lecture segment) for your program in step (b). For your trace, assume A=5 and B=2. Multiply Algorithm: Flow Chart/"State Diagram State 0: B >O? Our program has 4 possible states. PC - will hold that state! while (B > 0) { C = C + A; B = B - 1; True, next state =1 State 1: C = C +A Goto state 2 State 2: B = B - 1 // END PROG. Go back to state o False, next state = 3 Program done, Stay in state 3 forever State 3: Loop Multiply Algorithm: Control Memory Contents The complete algorithm shown in binary Algorithm: AR2 WE NZP NextPC Functionality: while (B >0){ C = C +A; B = B - 1; ROWO 1 000 x 0 110 011 TEST: is B > 0 ROW 1 10100 010100 000 C=C+A 0 | 1 - ROW 2 011 001 111 000 Register File: RO = 0 (for comparison) R1 = 1 (to subtract from B) R2 = A (initially 5 for ex.) R3 = B (initially 2 for ex.) R4 = C (initially ) B=B-1 and loop back to rowo ROW 3 X X X X 0 111 011 Loop forever on row 3 NZP Test Tricks NZP Condition: 000 Forces output to O NZP Condition: 111 Forces output to 1 8 #3 +/- X Multiply Execution Trace Register values before PC "executes" Clock Cycle 0 1 2 3 4 5 6 7 PC (State) #0 #1 #2 #0 #1 #2 #0 #3 1 1 0 1 1 To AR1 3 4 3 3 4 3 3 X X 0 2 1 to 12 WE Aw 11100 X xxxo | AR 0 OOX xoo X ALUout 5 RO R1 R2 (A) R3 ("B") 2 0 O 0 R4 ("C") 0 5 5 10 10 10 0 B>O? 0 C=C+A 5 B=B-1 10 B=B-1 Operation B>O? C=C+A B>0? LOOP LOOP Example: A=5, B=2 X = "don't care
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
