Vhdl Temperature simulation help

Click For Summary
SUMMARY

The forum discussion focuses on troubleshooting VHDL code for a thermostat and an 8-bit up/down counter. The user initially faced issues with simulation discrepancies, which were resolved by adjusting the simulation tool settings. The provided VHDL code for both components includes a thermostat entity that compares input values and an up/down counter that increments or decrements based on control signals. Key components include the use of IEEE libraries and proper signal handling in the architecture.

PREREQUISITES
  • Understanding of VHDL syntax and structure
  • Familiarity with IEEE libraries, specifically ieee.std_logic_1164 and ieee.std_logic_unsigned
  • Knowledge of simulation tools for VHDL, such as ModelSim or Vivado
  • Basic concepts of digital logic design, including counters and comparison operations
NEXT STEPS
  • Explore VHDL simulation tool settings and configurations
  • Learn about VHDL signal assignment and process sensitivity lists
  • Research synchronous counter design techniques in VHDL
  • Study the use of VHDL libraries for advanced data types and operations
USEFUL FOR

VHDL developers, digital design engineers, and students learning about hardware description languages and digital circuit design.

keith03
Messages
31
Reaction score
0
Vhdl help!

Please help...This is driving me crazy. I am just trying to setup a simple comparing component. The code compiles fine, but the simulation is WAAAAAYY off. could somebody please check this? Thanks

--Temprature high or low
--
library ieee;
use ieee.std_logic_1164.all;
entity thermostat is
port
(
data_in_mux : in std_logic_vector (3 downto 0);
set_main : in std_logic_vector (3 downto 0);
data_out : out std_logic_vector (1 downto 0)
);
end thermostat;
--
architecture behave of thermostat is
begin
process (set_main, data_in_mux)
begin

if (set_main < data_in_mux) then
data_out <= "00";
elsif (set_main > data_in_mux) then
data_out <= "11";
else data_out <= "01";

end if;
end process;
end behave;
 
Engineering news on Phys.org


I figured it out, the code was fine, but the simulation tool was not appropriatly set.
 


hello everyone!
i have to do a sychronous 8-bit up/down counter.
to the momment i am here. My entity is right.
As for the up/down control, we have the inputs up and down,
and If up = 1 it counts up, if down =1 it counts down and if both of them are 1 it does nothing.

can anyone help?

this is what i have done so far.

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity up_down_counter is
port (
count :out std_logic_vector (7 downto 0);
data :out std_logic_vector (7 downto 0);
up,down :in std_logic; -- up_down control for counter
clk :in std_logic; -- Input clock
reset :in std_logic -- Input reset
);
end entity;

architecture rtl of up_down_counter is

signal count :std_logic_vector (7 downto 0);
begin
process (clk, reset) begin
if (reset = '1') then
count <= (others=>'0');
elsif (rising_edge(clk)) then
if (up XOR down = '1') then
if(up = '1') then
count <= count + 1;
else
count <= count - 1;
end if;
end if;
end if;
end process;
count <= count;
end architecture;
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
23K
Replies
4
Views
5K
Replies
1
Views
9K
  • · Replies 3 ·
Replies
3
Views
11K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K