Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

fixed point representation

Status
Not open for further replies.

lokesh@88

Newbie level 4
Newbie level 4
Joined
Feb 23, 2015
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
37
sir
i want to design one model where input and output both are fixed point . if we will give some selected input then output should be its corresponding output. i have written a code is it write?



Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library IEEE_proposed;
use IEEE_proposed.fixed_pkg.ALL;
entity inv_q is
 
  port ( address : in ufixed(1 downto -2);
         data : out ufixed(1 downto -8) );
end inv_q;
 
architecture Behavioral of inv_q is
 
begin
 
process (address)
   begin
     case address is
       when "0000" => data <= "1000001101";
       when "0001" => data <= "1001010011";
       when "0010" => data <= "0111100001";
       when "0011" => data <= "0111000000";
       when "0100" => data <= "0110100101";
       when "0101" => data <= "0110001110";
       when "0110" => data <= "0101111001";
       when "0111" => data <= "0101100111";
       when "1001" => data <= "0101010111";
       when "1010" => data <= "0101001000";
        when others => data <="0000000000";
     end case;
  end process;
 
end Behavioral;

 
Last edited by a moderator:

The code is basically correct and synthesizable, as far as I'm aware of. I would use to_ufixed() for a visual representation of literals.

If the look-up table is intended for synthesis in internal block RAM, it may need registered addresses, depending on the used FPGA family.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top