pr_step3 - -PROJECT Step 3 - Component Instantiation and...

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

View Full Document Right Arrow Icon
------------------------------------------------------------------------------- --PROJECT Step 3 - Component Instantiation and the Generate Statement -- --NAME: Amal Hassan -- --YOU CAN USE THE ENTITIES AND ARCHITECUTRES FROM STEP 2 --For the generic_function, carry_chain, and 1_bit_ALU --They are in the library and if you completed the last assignment --correctly they can again be used here. ------------------------------------------------------------------------------- -- Enter your Entity for an 8 Bit ALU here ------------------------------------------------------------------------------- ENTITY alu8bit IS PORT (Cin: IN bit;A,B: IN bit_vector(7 downto 0);P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0: IN bit;Cout: OUT bit;Zout: OUT bit_vector(7 downto 0)); END alu8bit; ------------------------------------------------------------------------------- -- Enter your Structural Architecture for a 8 Bit ALU here -- using 8 component instantiations ------------------------------------------------------------------------------- ARCHITECTURE long of alu8bit is COMPONENT alu_1bit PORT (Cin,A,B: IN bit;P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0: IN bit;Cout: OUT bit; Zout: OUT bit); END COMPONENT; FOR ALL: alu_1bit USE ENTITY WORK.alu_1bit; SIGNAL Co,Za: bit_vector(7 downto 0); SIGNAL Coa: bit; Begin G0: alu_1bit PORT MAP (Cin,A(0),B(0),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(0),Za(0)); G1: alu_1bit PORT MAP (Co(0),A(1),B(1),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(1),Za(1)); G2: alu_1bit PORT MAP (Co(1),A(2),B(2),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(2),Za(2)); G3: alu_1bit PORT MAP (Co(2),A(3),B(3),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(3),Za(3)); G4: alu_1bit PORT MAP (Co(3),A(4),B(4),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(4),Za(4)); G5: alu_1bit PORT MAP (Co(4),A(5),B(5),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(5),Za(5)); G6: alu_1bit PORT MAP (Co(5),A(6),B(6),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(6),Za(6)); G7: alu_1bit PORT MAP (Co(6),A(7),B(7),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Coa,Za(7)); Cout <= Coa; Zout <= Za; End long;
Background image of page 1

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

View Full DocumentRight Arrow Icon
------------------------------------------------------------------------------- -- Enter your Structural Architecture for a 8 Bit ALU here -- using component instantiation for the lsb and msb and -- a generate statement for the remaining slices ------------------------------------------------------------------------------- ARCHITECTURE small of alu8bit is COMPONENT alu_1bit PORT (Cin,A,B: IN bit;P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0: IN bit;Cout: OUT bit; Zout: OUT bit); END COMPONENT; FOR ALL: alu_1bit USE ENTITY WORK.alu_1bit; SIGNAL Co,Zb: bit_vector(7 downto 0); SIGNAL Cob: bit; Begin H0: alu_1bit PORT MAP (Cin,A(0),B(0),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(0),Zb(0)); H1to6 : FOR i IN 1 to 6 GENERATE H: alu_1bit PORT MAP (Co(i- 1),A(i),B(i),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Co(i),Zb(i)); END GENERATE; H7: alu_1bit PORT MAP (Co(6),A(7),B(7),P3,P2,P1,P0,K3,K2,K1,K0,R3,R2,R1,R0,Cob,Zb(7)); Cout <= Cob; Zout <= Zb; End small; -------------------------------------------------------------------------------
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/19/2011 for the course ECE 762 taught by Professor Degroat during the Winter '11 term at Ohio State.

Page1 / 6

pr_step3 - -PROJECT Step 3 - Component Instantiation and...

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

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