Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

this is a 8X3 ROM.my problem is how to implement a function into it that gives m

ID: 1716334 • Letter: T

Question

this is a 8X3 ROM.my problem is how to implement a function into it that gives me the largest number.

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

entity ROM is
port(   Clock : in std_logic;
   Reset   : in std_logic;  
   Enable   : in std_logic;
   R   : in std_logic;
   address: in std_logic_vector (2 downto 0);
   Data_out : out std_logic_vector (0 to 7)
);
end ROM;

--------------------------------------------------------------

architecture Behav of ROM is

type ROM_Array is array (0 to 7) of std_logic_vector(2 downto 0);
   signal addr: std_logic_vector(2 downto 0);

constant Content: ROM_Array := (
0 => "001",         
1 => "010",      
2 => "011",      
3 => "100",       
4 => "101",      
5 => "110",       
6 => "111",      
7 => "000"  
   );   

begin
process(Clock, Reset, R)
begin
if( Reset = '0' ) then
   addr <= "000";
elsif( Clock'event and Clock = '1' ) then
   if Enable = '1' then
       if( R = '1' ) then
       addr <= Content(conv_integer(addr));
   else
addr <= "111";
   end if;
   end if;
end if;
end process;
end Behav;

Explanation / Answer

it is simple and based on inputs, in the programme provided 3 (0-2) inputs and gives 2^3=8 (0 to 7) outputs. so if we change input as required it gives large number of output