▷ Maximum to minimum ordering of values in #RAM memory using #VHDL
⭐⭐⭐⭐⭐ Maximum to minimum ordering of values in #RAM memory using #VHDL
- ➡️ #DigitalSystems #DigitalElectronic #DigitalCircuits #HDL #VHDL #FPGA
The following functional partition, which includes a Machine Sequential Synchronous (MSS), must perform a sorting of 255 values from Highest to Lowest. The entry of these 8-bit values must be done one by one, these values are entered through the "Data" port, while the data is being entered, the MSS sets high the "WritingData" output, indicating that this process is being executed and it will not end until the 255 values are completed. The ordering of the previously entered numbers should be done from highest to lowest, for which it is recommended to use the counter_up "j" and counter_up "i" in the search and comparison process. It is requested:
- Perform the functional partitioning
- Draw the ASM diagram of the MSS controller.
- Create in Quartus the Block diagram Schematic file
- Simulate the operation of the complete system in the VWF file.
- ☑️ Repository with VHDL codes:
- ☑️ Functional Partition PDF:
- sumador.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; --Entity entity Sumador is generic ( n: integer :=8);--<------- nbits port( X,Y: in std_logic_vector(n-1 downto 0); S: out std_logic_vector(n downto 0)); end Sumador; --Architecture architecture solve of Sumador is -- Signals,Constants,Variables,Components begin s<=('0'&x)+('0'&y);--Without the sign bit --s<='0'&(x+y);--with sign bit end solve;
- mss.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com -- By Angel Zumba -- MSS library ieee; use ieee.std_logic_1164.all; entity MSS is port (clk, resetn, start,WriteData, Fin_j, AmenB, Fin_i: in std_logic; enj,ldj,WritingData,s1,eni,ldi,enReg,Sel,enReg2,sel3,sel2,done: out std_logic); end MSS; architecture solv of MSS is type estado is (A,B,C,D,E,F,G,H,I,J,K); signal y: estado; signal entradas: std_logic_vector(4 downto 0); signal salidas: std_logic_vector(11 downto 0); begin entradas <= start & WriteData & Fin_j & AmenB & Fin_i; enj <= salidas(11); ldj <= salidas(10); WritingData <= salidas(9); s1 <= salidas(8); eni <= salidas(7); ldi <= salidas(6); enReg <= salidas(5); Sel <= salidas(4); enReg2 <= salidas(3); sel3 <= salidas(2); sel2 <= salidas(1); done <= salidas(0); process(clk, resetn) begin if resetn = '0' then y <= A; elsif (clk' event and clk = '1') then case y is when A => if entradas = "10000" then y <= B; else y <= A; end if; when B => if entradas = "10000" then y <= B; else y <= C; end if; when C => if entradas = "01000" then y <= D; elsif entradas = "01100" then y<= E; else y <= C; end if; when D => y <= C; when E => if entradas = "00100" then y <= J; else y <= F; end if; when F => y <= G; when G => if entradas = "00010" then y <= H; else y <= I; end if; when H => y <= I; when I => if entradas = "00100" then y <= E; else y <= G; end if; when J => if entradas = "10000" then y <= K; else y <= J; end if; when K => if entradas = "10000" then y <= K; else y <= A; end if; end case; end if; end process; process(y) begin salidas <= "000000000000"; case y is when A => salidas <= "110000000000"; when C => if entradas = "01100" then salidas <= "111100000000"; elsif entradas = "01000" then salidas <= "001100000000"; else salidas <= "001000000000"; end if; when D => salidas <= "100000000000"; when F => salidas <= "000011100000"; when G => if entradas = "00010" then salidas <= "000100011100"; else salidas <= "000000011100"; end if; when H => salidas <= "000100000110"; when I => if entradas = "00001" then salidas <= "100000000000"; else salidas <= "000010000000"; end if; when J => salidas <= "000000000001"; when others => salidas <= "000000000000"; end case; end process; end solv;
- comparador.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; --Entity Entity comparador is generic ( n: integer := 8);--<-- nbits Port( A: in std_logic_vector(n-1 downto 0); B: in std_logic_vector(n-1 downto 0); AmenorB, AmayorB, AigualB: out std_logic); end comparador; --Architecture Architecture solve of comparador is -- Signals,Constants,Variables,Components Begin AmenorB<='1' when A<B else '0'; AmayorB<='1' when A>B else '0'; AigualB<='1' when A=B else '0'; end solve;
- contador_up.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; --Entity entity contador_up is generic ( n: integer :=8);--<------- nbits port( Clk,resetn,en,ld: in std_logic; D: in std_logic_vector(n-1 downto 0); q: buffer std_logic_vector(n-1 downto 0)); end contador_up; --Architecture architecture solve of contador_up is -- Signals,Constants,Variables,Components begin --Process #1 process(resetn,clk) --Sequential programming begin if resetn='0' then q<=(others => '0'); elsif clk'event and clk='1' then if en='1' and ld='0' then q<=q+1; elsif en='1' and ld='1' then q<= D; end if; end if; end process; --Process #n... end solve;
- mux2a1.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; --Entity entity mux2a1 is generic ( n: integer:=8);--<-- nbits port( A: in std_logic_vector(n-1 downto 0); B: in std_logic_vector(n-1 downto 0); Sel: in std_logic; en: in std_logic; Q: out std_logic_vector(n-1 downto 0)); end mux2a1; --Architecture architecture solve of mux2a1 is -- Signals,Constants,Variables,Components signal f: std_logic_vector(n-1 downto 0); begin with Sel select f<= A when '0', B when others; Q<= f when en='1' else (others=>'0'); end solve;
- ram.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; --Entity entity ram is generic(n: integer:=8;-- n-bits per data m: integer:=8); -- m-bits of addresses port( clk,wr: in std_logic; addr : in std_logic_vector(m-1 downto 0); Din : in std_logic_vector(n-1 downto 0); Dout : out std_logic_vector(n-1 downto 0)); end ram; --Architecture architecture solve of ram is -- Signals,Constants,Variables,Components type ram_type is array (0 to (2**m)-1) of std_logic_vector(n-1 downto 0); signal tmp_ram: ram_type; begin --Process #1: process(clk,wr) --Sequential programming begin if (clk'event and clk='1') then if wr='1' then --write tmp_ram(conv_integer(addr)) <= Din; end if; end if; end process; Dout <= tmp_ram(conv_integer(addr));--read --Process #n... end solve;
- registro.vhdThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
--https://vasanza.blogspot.com --Library library ieee; use ieee.std_logic_1164.all; --Entity entity registro is generic ( n: integer :=8);--<-- nbits port( Clk,resetn,en: in std_logic; d: in std_logic_vector(n-1 downto 0); q: out std_logic_vector(n-1 downto 0)); end registro; --Architecture architecture solve of registro is -- Signals,Constants,Variables,Components begin --Process #1 process(resetn,clk) --Sequential programming begin if resetn='0' then q<=(others => '0'); elsif clk'event and clk='1' then if en='1' then q<=d; end if; end if; end process; --Process #n... end solve;
- ⭐ https://github.com/vasanza/DigitalSystems
- ⭐ https://github.com/vasanza/MSI_VHDL
- ✅ 2021 PAO1: Example, Maximum number finder and repetition counter
- ✅ 2020 PAO2: Examen de Mejoramiento
- ✅ 2020 PAO2: Examen 2da Evaluación
- ✅ 2020 PAO2: 2da Lección C4
- ✅ 2020 PAO2: Examen 1ra Evaluación
- ✅ 2020 PAO2: 1ra Lección C1-2
- ✅ 2021 PAO1: Proyectos Propuestos
- Digital System Implementation (2)
- Digital System Implementation (1)
- Example: Determinant of a matrix
- Example: Numeric Sequence Detector
- Example: Efficient Number Sequence Detector
- Example: set operations
- Example: communication and checksum validation
- Example: Sum of Products Karnaugh Map
- Example: Multiplying 3x4 matrix by 4x3 matrix
- Example: Consecutive 1's Counter
- Example: Numeric Sequence Counter
- Example: Serial communication receiver
- Example: billing system for telephone booths
- Example: Temperature Conditioner
- Example: Access control system (2)
- Example: Access control system (1)
Comentarios
Publicar un comentario