Write a complete VHDL program that finds maximum of three unsigned numbers using concurrent statements only. Assume these numbers are 8 bit wide. How does your program change if these numbers are signed?
GIVEN THAT:-
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.math_real.ALL;
entity findmax is
port (
clk : in std_logic;
clr : in std_logic;
din : in real;
max : out real;
);
end findmax ;
architecture Behavioral of findmax is
signal m : real := 0.0;
begin
process begin
wait until rising_edge(clk);
if clr='1' then
m <= 0.0;
elsif din>m then
m <= din;
end if;
end if;
end process;
max <= m;
end Behavioral;
Let me know if you have any doubts or if you need anything to
change.
If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions
Get Answers For Free
Most questions answered within 1 hours.