science

Esta revista es de un servidor federado y podría estar incompleta. Explorar más contenido en la instancia original.

dejo, sr

Hi, I'm not quite sure if this vhdl code and testbench is correct for the given task. Can you take a look?

Design a one-hour kitchen timer. The device should have buttons/switches to start and stop the timer, as well as to set the desired time interval for the alarm. Realize the task using the software package Quartus or in GHDL, confirm the correctness of the project task by simulation.

This is VHDL code:

use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity Kitchen_Timer is
  port (
    clk   : in std_logic;    -- Clock input
    reset : in std_logic;    -- Reset input
    start : in std_logic;    -- Start button input
    stop  : in std_logic;    -- Stop button input
    alarm : out std_logic    -- Alarm output
  );
end entity Kitchen_Timer;

-- Declare the architecture for the kitchen timer
architecture Behavioral of Kitchen_Timer is
  signal count     : integer range 0 to 3600 := 0;   -- Counter for timer
  signal alarming  : std_logic := '0';               -- Signal to indicate alarming interval
  signal alarm_en  : std_logic := '0';               -- Signal to enable alarming interval
  signal alarm_cnt : integer range 0 to 600 := 0;    -- Counter for alarming interval
begin
  -- Process to control the kitchen timer and alarming interval
  process (clk, reset)
  begin
    if (reset = '1') then
      count     <= 0;
      alarming  <= '0';
      alarm_en  <= '0';
      alarm_cnt <= 0;
    elsif (rising_edge(clk)) then
      if (stop = '1') then
        count     <= 0;
        alarming  <= '0';
        alarm_en  <= '0';
        alarm_cnt <= 0;
      elsif (start = '1' and count < 3600) then
        count <= count + 1;
        if (count = 3600) then
          count     <= 0;
          alarming  <= '0';
          alarm_en  <= '0';
          alarm_cnt <= 0;
        elsif (count > 0) then
          alarm_en <= '1';
        end if;
      end if;

      if (alarm_en = '1') then
        if (alarm_cnt < 600) then
          alarm_cnt <= alarm_cnt + 1;
        else
          alarm_cnt <= 0;
          alarming  <= '1';
        end if;
      end if;
    end if;
  end process;

  -- Assign the alarm output
  alarm <= alarming;
end architecture Behavioral; ```


This is Testbench:

```library ieee;
use ieee.std_logic_1164.all;

entity tb_Kitchen_Timer is
end tb_Kitchen_Timer;

architecture tb of tb_Kitchen_Timer is

    component Kitchen_Timer
        port (clk   : in std_logic;
              reset : in std_logic;
              start : in std_logic;
              stop  : in std_logic;
              alarm : out std_logic);
    end component;

    signal clk   : std_logic;
    signal reset : std_logic;
    signal start : std_logic;
    signal stop  : std_logic;
    signal alarm : std_logic;

    constant TbPeriod : time := 1000 ns; -- EDIT Put right period here
    signal TbClock : std_logic := '0';
    signal TbSimEnded : std_logic := '0';

begin

    dut : Kitchen_Timer
    port map (clk   => clk,
              reset => reset,
              start => start,
              stop  => stop,
              alarm => alarm);

    -- Clock generation
    TbClock <= not TbClock after TbPeriod/2 when TbSimEnded /= '1' else '0';

    -- EDIT: Check that clk is really your main clock signal
    clk <= TbClock;

    stimuli : process
    begin
        -- EDIT Adapt initialization as needed
        start <= '0';
        stop <= '0';

        -- Reset generation
        -- EDIT: Check that reset is really your reset signal
        reset <= '1';
        wait for 100 ns;
        reset <= '0';
        wait for 100 ns;

        -- EDIT Add stimuli here
        wait for 100 * TbPeriod;

        -- Stop the clock and hence terminate the simulation
        TbSimEnded <= '1';
        wait;
    end process;

end tb;

-- Configuration block below is required by some simulators. Usually no need to edit.

configuration cfg_tb_Kitchen_Timer of tb_Kitchen_Timer is
    for tb
    end for;
end cfg_tb_Kitchen_Timer;```

 #science

T4V0,
@T4V0@kbin.social avatar

@dejo

can you send me the code with the modifications so that I know what exactly you mean?

I would rather not, as it isn't a good learning experience for you, and would require some time for me to write the code.

Though if you have any questions about my previous answer, feel free to ask me about it.

As a freebie for you, pay attention to the alarming signal, and the condition that has been set: "The device should have buttons/switches to start and stop the timer, as well as to set the desired time interval for the alarm.". If I wanted the alarm to ring after 50 minutes, how would I do that? And what happens when the timer starts?

From the code I see here, the alarm is going to ring 10 minutes after being started, and it won't stop until an hour passes. And it has no way to set a time for it to ring, it always rings after 10 minutes.

And, not only that, the start signal is never set in the testbench, so the timer is never going to begin.

T4V0,
@T4V0@kbin.social avatar

@dejo

What do you think about the specifications that the project requires, should I stick to your code or should I add something from my own code?

I would stick to my code, your alarm isn't going to work properly due to its comparisons as I mentioned in my previous comments. But if you want to improve the code I modified, you can change the adjust_interval_up and adjust_interval_down buttons to be synchronized to their own states rather than the clock (make their own process with their signals added to the signal sensitivity list and add an extra asynchronous condition to zero the counter on the original process). If you don't make a change like this your alarm is going to take up to an hour to adjust its timer range.

Does your simulation correspond to a time of 1 hour and should there be alarming on the simulation?

Yes, if you have a 1/60 Hertz clock signal. And you must have alarming on the simulation as it is crucial to show that it works.

flatearth, en

Flat earth real life testimony 7/7

https://m.youtube.com/watch?v=kcn6e1dPtm0

You can visit and watch the whole 7.
Joyful Christmas in advance!
🎂 Celebrate the birthday of Christ so that your own birthday will be celebrated.

carturo222,

It has to be a joke that you posted it on the science forum of all places.

flatearth,

I too love science (I loved fluid mechanics).
I love testable science.
I love empirical science.
I hate pseudoscience.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

8 healthy habits linked to living decades longer: A study of more than 700,000 people found that adopting eight healthy habits by age 40 could extend life expectancy by more than two decades. https://archive.is/nxwDC

HamsterRage,

I love how not being a heroin addict is counted as a “healthy habit”. 😀

jsveiga,

“moderate alcohol consumption” is a healthy habit?

Does that mean that although I dislike alcohol and have zero alcohol consumption, I must start drinking “moderately” for a healthier life??

Hasn’t it been proven that there is no safe dose for alcohol consumption?

Or is society so brainwashed with alcohol that no one dares to say that it’s unhealthy in any dosage?

flatearth, en

There are those who believe they can bring into existence what they imagine.
On the other hand, there are those who don't even believe other people exist: they think their mind is the one forming images and that others are part of their mind.
As for me, I am intelligent and I believe in God.
Water did not create itself.
Let me hear from atheists who think water created itself.

flatearth,

Sorry. I forgot to end with "The earth is flat classroom students!"

DigitalNirvana,

I have a friend, who is a carpenter. I swear he can imagine a beautiful wooden cabinet, and with some hours of work with right tools and materials, honest, he can bring it into existence. It’s amazing!

readbeanicecream, en
@readbeanicecream@kbin.social avatar
JWBananas,
@JWBananas@startrek.website avatar

However, it’s still unclear what underlying mechanisms may allow antibiotic resistance to spread in air pollution. It will be important for future studies to investigate this.

Wat.

Increased air pollution -> More respiratory illnesses - > More over-prescribing of antibiotics -> More antibiotic resistance

Tomassci,
@Tomassci@kbin.social avatar

@JWBananas Or maybe the antibiotic resistant genes are taking a hitch ride on larger particles? I don't know, that is probably unlikely, but we've seen they can hitchhike into the atmosphere.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

Sun 'umbrella' tethered to asteroid might help mitigate climate change: An astronomer has proposed a novel approach -- a solar shield to reduce the amount of sunlight hitting Earth, combined with a tethered, captured asteroid as a counterweight.
https://www.sciencedaily.com/releases/2023/07/230731151552.htm

ratboy,
@ratboy@lemm.ee avatar

Mr. Burns would like a word…

V_,

doing literally anything and everything before actually addressing the root of climate change

readbeanicecream, en
@readbeanicecream@kbin.social avatar

Sick of hearing about record heat? Scientists say those numbers paint the story of a warming world: With a summer of extreme weather records dominating the news, meteorologists and scientists say records like these give a glimpse of the big picture: a warming planet caused by climate change. https://phys.org/news/2023-07-sick-scientists-story-world.html

Mane25,

My instinct, as a non-expert, is that what we should really be looking at is rolling-average trends rather than records, to minimise cherry-picking. Stories about records, rightly or wrongly, come across as sensationalist and potentially misleading. Am I wrong?

Helldiver_M,
@Helldiver_M@kbin.social avatar

@Mane25 Sure, here's the Annual global land-ocean temperature index. And the Annual Ocean heat average tempatures. Really, just go to town. Any Annual averaged data category gives some cause for alarm. Sea levels, CO2 levels, Methane levels, etc.

The climate records that are being broken regionally are a direct consequence of the trends shown above. If you read the article @readbeanicecream was kind enough to share, then you would have read that. "Records go back to the late 19th century, and we can see that there has been a decade-on-decade increase in temperatures," said Gavin Schmidt, director of NASA's Goddard Institute for Space Studies, keeper of the agency's climate records."

So no, I don't think this is sensationalist or misleading at all. You just need to dig past the headline a little bit. A headline that accurately reflects what scientists are saying is a direct consequence of the general trend that's going to continue to get worse and break more records into the future.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

Conspiracy theories are the new pandemic infecting public life: Millions of people, from all walks of life, have come to believe aspects of the QAnon conspiracy theory. Prevention is our only hope, says James Ball. James Ball is the author of The Other Pandemic: How QAnon contaminated the world
https://archive.is/DGKiV

eshep,

@readbeanicecream I thought QAnon was some silly fanatical Star Trek thing. 😆

readbeanicecream,
@readbeanicecream@kbin.social avatar

@eshep 🤣🤣🤣

Ralphsmith, en

Erase Watermarks with Precision

Don't let watermarks spoil your visual masterpiece. Pixbim Animate Photos AI is here to help you remove watermarks without a hint of blur. With unmatched precision, this cutting-edge tool effortlessly erases those pesky logos and imprints, leaving your images crystal clear. Bid farewell to distracting watermarks and welcome a new era of spotless visuals. Whether you're a professional photographer or a content creator, Pixbim Animate Photos AI ensures your work remains untainted. Transform your images with precision, unleash their true potential, and make your mark in the world of visuals.

Fullest,

This just facilitates theft.

mihair, en
@mihair@kbin.social avatar

Stevia, a zero-calorie sugar substitute, is recognized as safe by the Food and Drug Administration (FDA) and the European Food Safety Authority (EFSA). In vitro and in vivo studies showed that stevia has antiglycemic action and antioxidant effects in adipose tissue and the vascular wall, reduces blood pressure levels and hepatic steatosis, stabilizes the atherosclerotic plaque, and ameliorates liver and kidney damage. The metabolism of steviol glycosides is dependent upon gut microbiota, which breaks down glycosides into steviol that can be absorbed by the host. In this review, we elucidated the effects of stevia’s consumption on the host’s gut microbiota.
https://www.mdpi.com/2076-2607/10/4/744/htm

TheBest,

I have IBS and sugar makes it act up. I use stevia extract as a substitute in products, and I AM constantly working on improving my gut biome health. This was a dense but good read.

readbeanicecream, en
@readbeanicecream@kbin.social avatar
technologicalcaveman,

@readbeanicecream it's me. It's too big already.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

The US is investing more than $1 billion in carbon capture, but big oil is still involved: 1PointFive is helping oversee one plant in Texas. It also has direct ties to one of the world's largest fossil fuel producers.
https://www.popsci.com/environment/carbon-capture-plants-doe/

Knusper,

“1PointFive’s mission is to reduce atmospheric CO2 and help curb global temperature rise to 1.5°C by 2050 in alignment with Paris Agreement targets,”

Fucking hell, when even your organisation name is propaganda. This is what would need to happen for that +1.5°C target:

Projection for Global Warming showing that the +1.5°C target would require halving emissions until 2030.

No credible scientist still believes in us hitting that. Not the optimistic ones either.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

Teens engaged in activism become better critical thinkers, study finds: Youth involved in community-based activism over time become better critical thinkers and more politically active, according to a new University of Michigan study.
https://phys.org/news/2023-08-teens-engaged-critical-thinkers.html

mysoulishome,
@mysoulishome@lemmy.world avatar

Sending this to my teenage daughter. I love her but I wish she thought as much about social issues that affect her generation as she does about her hair color…

readbeanicecream, en
@readbeanicecream@kbin.social avatar

Why Do Cats Land on Their Feet? Physics Explains: As it turns out, felines can survive a fall from any height—at least in theory
https://archive.is/j55HE

galilette,

tl;dr: nothing specific to cats. It’s just an exercise of calculating “air friction” and terminal velocity. Same calculation would let a dog survive the fall no different.

readbeanicecream, en
@readbeanicecream@kbin.social avatar

What Life in Barbie’s Dazzlingly Pink World Would Do to Her Brain—And Yours: The Barbie movie’s plastic pink world might not be that fantastic in real life.
https://archive.is/JtFSn

LinkOpensChest_wav,
@LinkOpensChest_wav@lemmy.one avatar

Bad news, “Barbie” fans…

  • Todo
  • Suscrito
  • Moderado
  • Favoritos
  • random
  • noticiascr
  • science@kbin.social
  • CostaRica
  • Todos las revistas