Quatus simulation motor water injection control VHDL code design

**Digital circuit design basics
There is a water tower, and two motors MS and ML, one large and one small, drive the water pump to inject water into the water tower. When the water level of the water tower is above C, the water tower is not filled with water; when the water level drops to point C, it is driven by the small motor MS alone; when the water level drops to point B, the large motor ML is driven alone to fill the water tower; when it drops to point A, Then the two motors drive at the same time, as shown in the figure below. Try to design a logic circuit to control the operation of the motor. Requirements: Write down the design process and draw a logic diagram.
**
Insert image description here
Suppose the water level is 0 below A, B, and C, and 1 above A, B, and C. The motor MS and ML are 1 when they are started and 0 when they are closed.

truth table
Write logical algebraic expressions from truth tables

  1. Minimum term and or expression
  2. simplification
    Insert image description here

VHDL代码
library ieee;
use ieee.std_logic_1164.all;
entity water is
port(a,b,c: in std_logic; ys,yl: out std_logic);
end water;
architecture dataflow of water is
begin
process(a,b,c)
variable temp1:std_logic;
variable temp2:std_logic;
variable temp3:std_logic;
begin
temp1:=not b;
temp2:=not c;
yl<=temp1 and temp2;
temp3:=a xnor b;
ys<=temp2 and temp3;
end process;
end dataflow;

Logic diagram design
Insert image description here
RTL Viewer (VHDL code synthesis and generated circuit)
Insert image description here

Guess you like

Origin blog.csdn.net/m0_56256361/article/details/123671034