Quiz 9b (Winter 2012)

Report 3 Downloads 73 Views
McGill University Department of Electrical and Computer Engineering Course: ECSE 323-Digital Systems Design

Winter 2012

ASSIGNMENT #9A Friday

TOPIC: VHDL and Synthesis of Sequential Systems Question 1 20 points Write a complete VHDL code (except for describing the libraries) that represents a negative edge-triggered J-K flip-flop with synchronous active-low reset (active when reset=0) and synchronous enable inputs and the complementary outputs Q and Q’ (when enable=0, the flip-flop holds its previous value). Solution 1 LIBRARY ieee; -- the library and entity are optional USE ieee.std_logic_1164.all; ENTITY prob1 IS PORT (J, K, Resetn, Enable, Clock : IN STD_LOGIC; Q,Qb : OUT STD_LOGIC ); END prob1; ARCHITECTURE Behavior OF prob1 IS -–this part of the code is mandatory SIGNAL Qint : STD_LOGIC; BEGIN PROCESS (Clock) BEGIN IF Clock’EVENT AND Clock = ’0’ THEN IF Resetn = ’0’ THEN Qint