Question

In: Electrical Engineering

Using behavioral VHDL, 32-bit up counter with enable.

Using behavioral VHDL, 32-bit up counter with enable.

Solutions

Expert Solution

library IEEE;
use IEEE.std_logic_1164.all;

entity cntr is
  generic(left    : natural := 31;       
          prop    : time := 100 ps);     
  port   (clk     : in  std_logic;
          load    : in  std_logic;
          in_load : in  std_logic_vector (left downto 0);
          output  : out std_logic_vector (left downto 0) );
end entity cntr_g;

architecture behavior of cntr is
begin  
  cntr: process(clk, load)
          variable counter : std_logic_vector(left downto 0);
          variable carry   : std_logic;
          variable tcarry  : std_logic;
        begin
          if load='1' then
            counter := in_load;
            output <= in_load;
          elsif clk'event and clk='1' then 
            carry := '1';
            for i in 0 to left loop
              tcarry  := counter(i) and carry;
              counter(i) := counter(i) xor carry;
              carry := tcarry;
            end loop;
            output <= counter after prop;
          end if;
        end process cntr;
end architecture behavior;

Related Solutions

Using Behavorial VHDL, design a 4-bit up/down counter.
Using Behavorial VHDL, design a 4-bit up/down counter.
Describe in behavioral VHDL a modulo-m up/down counter with the following interface: – Generics • Modulo...
Describe in behavioral VHDL a modulo-m up/down counter with the following interface: – Generics • Modulo base (m with default value of 16) – Inputs Clock (clk  1 bit) Asynchronous reset (rst  1 bit) Counting direction (up_down1 bit) – 1Counting up – 0Counting down – Outputs 2 – Run behavioral simulation • Count value (count • In Vivado – Create a project   bits)
Create a VHDL code of a 4 bit Counter using D flip flop and a Frequency...
Create a VHDL code of a 4 bit Counter using D flip flop and a Frequency Divider that provides the clock signal input for counter
write sample code in VHDL Design and implementation of Pressetable ripple counter using behavioral style of...
write sample code in VHDL Design and implementation of Pressetable ripple counter using behavioral style of modeling by using pic74196
Write the VHDL codes for (7494) 4 bit shift register using Behavioral style of modeling. this...
Write the VHDL codes for (7494) 4 bit shift register using Behavioral style of modeling. this is the datasheet for this Quation ( http://www.ralphselectronics.com/productimages/SEMI-SN7494N.PDF )
3-(7494) Design and implementation of 4 bit shift register using VHDL Behavioral style of modeling
3-(7494) Design and implementation of 4 bit shift register using VHDL Behavioral style of modeling
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code...
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code of 4-bit modulo-9 counter in ModelSim, and capture the screenshot of your simulated waveform. Assume clock period Tclk=100ns, initially, the counter is reset to Q3Q2Q1Q0=0000 you need to simulate a complete counting cycle plus one more additional clock period after it is reset to “0000” state.
Provide the VHDL specification of a hybrid 32-bit adder that cascades 2 12 bit carry look...
Provide the VHDL specification of a hybrid 32-bit adder that cascades 2 12 bit carry look ahead adders and one 10 bit carry look ahead adder. a) Compare your adder with a full 32-bit carry-look ahead in performance and cost. b) Compare your adder with a full combinational adder in performance and cost c) Compare your adder with a ripple-carry adder in performance and cost. d) Compare your adder to a bit serial (sequential) adder in performance and cost. e)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT