Theory:control the speed and direction of a DC motor using techniques like Pulse Width Modulation (PWM) and H-bridges.
DIAGRAM
Verilog code:
module dc-motor (y1, y2, dir);
output y1, y2;
input dir;
reg y1, y2;
always @ (dir)
begin
if (dir == 1)
begin
y1 = 1'b0; y2 = 1'b1;
end
else
begin
y1 = 1'b1; y2 = 1'b0;
end
end
end module
output wave form:
Device utilization :
RTL schematic view: