How to resolve the algorithm FizzBuzz step by step in the VHDL programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm FizzBuzz step by step in the VHDL programming language

Table of Contents

Problem Statement

Write a program that prints the integers from   1   to   100   (inclusive).

But:

The   FizzBuzz   problem was presented as the lowest level of comprehension required to illustrate adequacy.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm FizzBuzz step by step in the VHDL programming language

Source code in the vhdl programming language

entity fizzbuzz is
end entity fizzbuzz;

architecture beh of fizzbuzz is

	procedure fizzbuzz(num : natural) is
	begin
		if num mod 15 = 0 then
			report "FIZZBUZZ";
		elsif num mod 3 = 0 then
			report "FIZZ";
		elsif num mod 5 = 0 then
		    report "BUZZ";
		else
			report to_string(num);
		end if;
	end procedure fizzbuzz;

begin

	p_fizz : process is
	begin
		for i in 1 to 100 loop
		fizzbuzz(i);
		end loop;
		wait for 200 us;
	end process p_fizz;

end architecture beh;

  

You may also check:How to resolve the algorithm Determine if a string is numeric step by step in the Ruby programming language
You may also check:How to resolve the algorithm Conditional structures step by step in the Ruby programming language
You may also check:How to resolve the algorithm Inheritance/Single step by step in the Ruby programming language
You may also check:How to resolve the algorithm Duffinian numbers step by step in the Arturo programming language
You may also check:How to resolve the algorithm Five weekends step by step in the JavaScript programming language