sol10

sol10 - Chapter 10 10.1. In the modifed shiFt register the...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 10 10.1. In the modifed shiFt register the order oF the multiplexers that perForm the load and enable operations are reversed From the order in igure 10.4. Bit zero oF the modifed register is show below. D Q Q Q R Clock E 1 w L 1 10.2. ( a ) A modifed ASM chart that has only Moore-type outputs in state S2 is given below. Shift A Done A 0? = B s Load A a Reset S4 1 1 1 s B B 1 + Shift A S1 S2 S3 1 10-1 ( b ) EA Done = 1 z s a Reset S4 1 1 1 s EA, EB S1 S2 S3 LB 1 10-2 ( c ) module bitcount (Clock, Resetn, LA, s, Data, B, Done); input Clock, Resetn, LA, s; input [7:0] Data; output [3:0] B; output Done; wire [7:0] A; wire z; reg [1:0] Y, y; reg [3:0] B; reg Done, EA, EB, LB; // control circuit parameter S1 = 2b00, S2 = 2b01, S3 = 2b10, S4 = 2b11; always @(s or y or z) begin : State table case (y) S1: if (s == 0) Y = S1; else Y = S2; S2,S3: if (!z && !A[0]) Y = S2; else if (!z && A[0]) Y = S3; else Y = S4; S4: if (s == 1) Y = S4; else Y = S1; endcase end always @( posedge Clock or negedge Resetn) begin : State fipfops if (Resetn == 0) y < = S1; else y < = Y; end always @(y or A[0]) begin : FSM outputs EA = 0; LB = 0; EB = 0; Done = 0; // deaults case (y) S1: LB = 1; S2: EA = 1; S3: begin EA = 1; EB = 1; end S4: Done = 1; endcase end 10-3 // datapath circuit // counter B always @( negedge Resetn or posedge Clock) if (!Resetn) B < = 0; else if (LB) B < = 0; else if (EB) B < = B + 1; shiftrne ShiftA (Data, LA, EA, 0, Clock, A); assign z = | A; endmodule 10.3. ( a ) Done P P A + C n 1? = P 0 C , s Load A b C Reset S3 1 1 1 s S1 S2 1 Load B Shift left A, C C 1 + 10-4 ( b ) E L E DataA LA EA A Clock P 2 n DataP 2 n register EP Sum 2 n 2 n B n DataB LB 2 n + L E Counter . C LC EC Psel E Register b C z n-to-1 Shift-left log 2 n ( c ) The ASM chart for the control circuit is shown below. Note that we assume the EB signal is controlled by external logic. 10-5 EP z b C Reset S3 1 1 s 1 Done Psel = EP, LC , s 1 S1 S2 Psel 1 = EA EC , , ( d ) module multiply (Clock, Resetn, LA, LB, s, DataA, DataB, P, Done); parameter n = 8; parameter m = 3; input Clock, Resetn, LA, LB, s; input [n- 1:0] DataA, DataB; output [n+n- 1:0] P; output Done; wire bc, z; reg [n+n- 1:0] DataP; wire [n+n- 1:0] A, Sum; reg [1:0] y, Y; wire [n- 1:0] B; wire [m- 1:0] C; reg Done, EA, EP, Psel, LC, EC; integer k; 10-6 // control circuit parameter S1 = 2b00, S2 = 2b01, S3 = 2b10; always @(s or y or z) begin : State table case (y) S1: if (s == 0) Y = S1; else Y = S2; S2: if (z) Y = S3; else Y = S2; S3: if (s == 1) Y = S3; else Y = S1; default : Y = 2bxx; endcase end always @( posedge Clock or negedge Resetn) begin : State fipfops if (Resetn == 0) y < = S1; else y < = Y; end always @(y or bc) begin : FSM outputs EA = 0; EP = 0; Done = 0; Psel = 0; EC = 0; LC = 0; // deaults case (y) S1: begin EP = 1; EC = 1; LC = 1; end S2: begin EA = 1; Psel = 1; EC = 1; LC = 0; if (bc) EP = 1; else EP = 0; end S3: Done = 1; endcase end // datapath circuit...
View Full Document

Page1 / 50

sol10 - Chapter 10 10.1. In the modifed shiFt register the...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online