Question

In: Electrical Engineering

In VHDL with Xilinx Vivado, design a PWM circuit as described in the Background and Theory...

In VHDL with Xilinx Vivado, design a PWM circuit as described in the Background and Theory section. The central part will be 0 to 9 counter, with an integrated comparator. VHDL supports < and > as comparisons. You will just need to integrate a PWM output into the counter. For simulation, use a 10 kHz clock to the counter, which will result in a 1 kHz PWM signal. Simulate a 0%, 30%, 70% and 100% duty cycle.

Solutions

Expert Solution

library ieee;

use ieee.std_logic_1164.all;

entity pwm is

port

( clk : in std_logic;

pwm_out : buffer std_logic

);

end entity;

architecture rtl of pwm is

begin

process (clk)

--variable to count the clock pulse

variable count : integer range 0 to 50000;

--variable to change duty cycle of the pulse

variable duty_cycle : integer range 0 to 50000;

--variable to determine whether to increse or decrese the dutycycle

variable flag : integer range 0 to 1;

begin

if (rising_edge(clk)) then

--increasing the count for each clock cycle

count= count+1;

--setting output to logic 1 when count reach duty cycle value

--output stays at logic 1 @ duty_cycle <= count <=50000

if (count = duty_cycle then

pwm_out <= '0';

count:= 0;

--after each complete pulse the duty cycle varies

if(flag = 0) then

duty_cycle:= duty_cycle+50;

else

duty_cycle:= duty_cycle-50;

end if;

-- flag changes when duty_cycle reaches max and min value

if(duty_cycle = 50000) then

flag:= 1;

elseif(duty_cycle = 0) then

flag:= 0;

end if;

end if;

end if;

end process;

end rtl;


Related Solutions

What type of the combinational circuit is described by the following VHDL process? process (A,B)   ...
What type of the combinational circuit is described by the following VHDL process? process (A,B)    begin    if (A = '0' and B = '1') OR (A='1' AND B='0') then    Y <= '1';    else    Y <= '0';    end if;    end process; 1. XOR gate 2. XNOR gate 3. 2-to-1 MUX 4. half adder
Create a 4-bit full adder design using VHDL in vivado 2017.2. Project description: You need to...
Create a 4-bit full adder design using VHDL in vivado 2017.2. Project description: You need to create a vhd file for the four-bit full adder. Note: Instead of using bit, please use std_logic; instead of using bit_vector, please use std_logic_vector. One simulation source is required, i.e. testbench Please don't write out on paper. Code written out in text or screen shots would be very much apprecitated.
One integrated circuit design calls for the diffusion of arsenic into silicon wafers; the background concentration...
One integrated circuit design calls for the diffusion of arsenic into silicon wafers; the background concentration of As in Si is 2.5 × 1020 atoms/m3. The predeposition heat treatment is to be conducted at 1000°C for 45 minutes, with a constant surface concentration of 8 × 1026 As atoms/m3. At a drive-in temperature of 1100°C, determine the diffusion time required for a junction depth of 1.2 μm. For this system, values of Qd and D0 are 4.10 eV and 2.29...
Design and write a verilog code and testbench for a 16-bit RISC MIPS Processor on vivado...
Design and write a verilog code and testbench for a 16-bit RISC MIPS Processor on vivado and show waveform.
Design in VHDL a 8-1 Multiplexer Screenshot the simulation and code.
Design in VHDL a 8-1 Multiplexer Screenshot the simulation and code.
Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Design on of these 3 circuits : Direction circuit ,Pressure circuit ,sequentional circuit one of these*
Design on of these 3 circuits : Direction circuit ,Pressure circuit ,sequentional circuit one of these*
Design a 4-to-1 multiplexer using VHDL a- use with-select-when statement in writing VHDL file generate timing...
Design a 4-to-1 multiplexer using VHDL a- use with-select-when statement in writing VHDL file generate timing diagram
Using Behavorial VHDL, design a 4-bit up/down counter.
Using Behavorial VHDL, design a 4-bit up/down counter.
Design a “disk spinning” animation circuit for a CD player. The input to the circuit will...
Design a “disk spinning” animation circuit for a CD player. The input to the circuit will be a 3-bit binary number A1, A2, A3 provided by 3-bit up counter. The circuit for 3-bit counter has already been provided in CCT file on Google Classroom, so there is no need to design the up counter yourself. The animation will appear on the top four lights of the LED display of Figure, i.e., on X1, X2, X7, and X6, going clockwise as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT