Question

In: Electrical Engineering

From "Digital Electronics a practical approach with VHDL" by William Kleitz 9th edition. FPGA question C10-6.The...

From "Digital Electronics a practical approach with VHDL" by William Kleitz 9th edition. FPGA question C10-6.The VHDL problem in Figure 10-42(a) is the implementation of a J-K flip-flop.

(a) Make the necessary program additions to provide active-LOW asynchronous Set and Reset. Save this program as prob_c10_6.vhd.

Solutions

Expert Solution

In the above table Reset_bar Has the Highest priority than Set_bar

//////////The VERILOG code shown below///////////////////

module jkffasync(J,K,SET_N, RST_N,Qout);

    input J,K,SET_N, RST_N; // this is inputs
    input Clk; //clock
    output Qout; //output (Q)
    reg Qout;
  
always@ (posedge(Clk) or negedge(RST_N) or negedge(SET_N))
    begin
      if(RST_N == 0) //This signal has high priority.
            Qout = 0;
        else  
          if(SET_N == 0) //This signal set has next priority
                Qout = 1;
            else
              
                 if(J == 0 && K == 0)  
                    Qout = Qout;      //no change state
                 else if(J == 0 && K == 1)
                    Qout = 0;         //// //reset state
                 else if(J == 1 && K == 0)
                    Qout = 1;         ////////set state
                 else
                    Qout = ~Qout;      //TOGGLE the previous output
            
    end
  
endmodule

--------VHDL CODE---

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;


entity jkffasync_rst_set is
port ( clk:     in std_logic;
          J, K:               in std_logic;
          Q, Qbar:       out std_logic;
          RST_N,SET_N:              in std_logic
);
end jkffasync_rst_set ;


architecture Beh of jkffasync_rst_set is

signal qtmp,qbartmp : std_logic :='0';
begin


process(clk,RST_N,SET_N)
begin
   if(RST_N = '1') then        
    qtmp <= '0';
    qbartmp <= '1';
    elsif(SET_N = '1') then         
    qtmp <= '0';
    qbartmp <= '1';
   elsif( rising_edge(clk) ) then
      if(J='0' and K='0') then   
       NULL;
      elsif(J='0' and K='1') then
       qtmp <= '0';
       qbartmp <= '1';
       elsif(J='1' and K='0') then  
       qbartmp <= '0';
       else                       
       qtmp <= not qtmp;
       qbartmp <= not qbartmp;
      end if;
   end if;
end process;
Q <= qtmp;
Qbar <= qbartmp;

end Beh;

//(If you satisfied rate the answer If you have any query leave a comment, Thank you)


Related Solutions

The question came from a book called Computers in the Medical Office (9th Edition) illustrates the...
The question came from a book called Computers in the Medical Office (9th Edition) illustrates the medical documentation and billing cycle. Some of the steps in the cycle, such as Step 2, Establish Financial Responsibility, focus more on billing activities. Explain how Step 4 includes a focus on both billing and clinical functions.
book: Fundamentals of Corporate Finance Alternate Edition (9th Edition) Conch Republic Electronics, Part 1 Conch Republic...
book: Fundamentals of Corporate Finance Alternate Edition (9th Edition) Conch Republic Electronics, Part 1 Conch Republic Electronics is a small electronics manufacturer located in Key West, Florida. The president of the company is Shelley Couts, who inherited the business. When the company was founded more than 70 years ago, it repaired radios and other devices for the home. With the passage of time, the company expanded to the manufacturing areas and today is a reputed producer of various electronic items....
Question #11 from Chpt. 3 of Macroeconomics (9th edition) Suppose that the government increases taxes and...
Question #11 from Chpt. 3 of Macroeconomics (9th edition) Suppose that the government increases taxes and government purchases by equal amounts. What happens to the interest rate and investment in response to this balanced-budget change? Explain how the answer depends on the marginal propensity to consume.
Accounting Theory (9th edition) Chapter 6 : the search of objective Critical thinking and analysis :...
Accounting Theory (9th edition) Chapter 6 : the search of objective Critical thinking and analysis : Question 1: Do you see an evolutionary process involving the documents and reports presented in this chapter? Explain.
The solution to question 101 of chapter 12 of Zumdahl Zumdahl chemistry 9th edition is only...
The solution to question 101 of chapter 12 of Zumdahl Zumdahl chemistry 9th edition is only partially answered. It does not calculate the activation energy.Here is the question. Experiments have shown that the average frequency of chirping by a snowy tree cricket (Oecanthus fultone) depends on temperature as shown in the table. Chirping rate: 178, 126, 100 Temperature (C) 25.0,20,3, 17.3 What is the apparent activation energy of the process that controls the chirping? What is the rate of chirping...
Database Systems: A Practical Approach to Design, Implementation, and Management, 6th Edition, Chapter 11 Database Analysis...
Database Systems: A Practical Approach to Design, Implementation, and Management, 6th Edition, Chapter 11 Database Analysis and the DreamHome Case Study. Based on Dreamhome Case Study; Title suitable for the project based on the case study? The problem statement ? Objectives? Boundary(scope)? User views? ExtraFeatures?
Problem 2.22 (modified from Montgomery, 9th edition) The mean shelf life of a carbonated drink should...
Problem 2.22 (modified from Montgomery, 9th edition) The mean shelf life of a carbonated drink should exceed 120 days. Ten bottles are randomly selected and tested, and the results below are obtained: shelf life (days) = {108, 124, 124, 106, 115, 138, 163, 159, 134, 139} a) Clearly state the hypothesis to be tested, first in English and then in mathematical expressions for H0 and H1. b) Test the hypothesis at significance level 0.01. Report both the p-value and a...
From Moral Issues in Business: Seventh Edition, by William H. Shaw and Vincent Barry; Wadsworth Publishing;...
From Moral Issues in Business: Seventh Edition, by William H. Shaw and Vincent Barry; Wadsworth Publishing; Belmont, CA, 1998, pp. 211-213. Asbestos is a fibrous mineral used for fireproofing electrical insulation, building materials, brake linings, and chemical filters. If exposed long enough to asbestos particles—usually ten or more years—people can develop a chronic lung inflammation called asbestosis, which makes breathing difficult and infection easy. Also linked to asbestos exposure is mesothelioma, a cancer of the chest lining that sometimes doesn’t...
Reference Material: Chapters 13-21 Spiceland Intermediate Accounting 9th Edition J David Spiceland Question 1: Identify 3...
Reference Material: Chapters 13-21 Spiceland Intermediate Accounting 9th Edition J David Spiceland Question 1: Identify 3 areas where the accounting appears to be most reasonable and useful to investors and creditors. State the accounting treatment and the reasoning in identifying the standard as strong or weak. Question 2: Identify 3 areas where you believe accounting is confusing, makes less sense and lack of value to investors and creditors. State the accounting treatment and the reasoning in identifying the standard as...
I am reviewing the International Economics textbook (10th edition), Chapter 14, Question 6. The question asks:...
I am reviewing the International Economics textbook (10th edition), Chapter 14, Question 6. The question asks: Part A: A 10,000 GBP deposit in a London bank in a year has an interest rate in pounds of 10%. The USD/GBP exchange rate moves from $1.50 per pound to $1.38 per pound. What is the dollar rate of return on this asset? This part I understood and I calculated as: Year 0 = 10,000 GBP * 1.50 exchange rate = 15,000 USD...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT