CARVIEW |
Select Language
HTTP/2 200
date: Tue, 14 Oct 2025 23:55:10 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=027de59ddb268e885b5b92eff18f614550401f9377f4474232dcbe29c6648f70a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22-4-bzJgTCsF0fjCQcu1Q_wmM90tQB0n-%22%3B%7D; HttpOnly; Path=/
cf-ray: 98eb018a8e46e8e0-BLR
VHDL Gray Code to Binary - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library IEEE;
- use IEEE.STD_LOGIC;
- use IEEE.NUMERIC_STD.ALL;
- -- Entity to convert Gray code to binary
- entity gray_code_converter is
- Generic (
- WIDTH : positive := 4
- );
- Port (
- clk : in STD_LOGIC;
- rst : in STD_LOGIC;
- gray : in STD_LOGIC_VECTOR (WIDTH-1 downto 0);
- binary : out STD_LOGIC_VECTOR (WIDTH-1 downto 0)
- );
- end gray_code_converter;
- architecture Behavioral of gray_code_converter is
- signal binary_int : STD_LOGIC_VECTOR (WIDTH-1 downto 0);
- begin
- -- Convert Gray code to binary
- process(clk)
- begin
- if rising_edge(clk) then
- if rst = '1' then
- binary_int <= (others => '0');
- else
- -- MSB of binary output is the same as MSB of Gray code
- binary_int(binary_int'high) <= gray(gray'high);
- -- Calculate remaining bits of binary output
- for i in binary_int'high-1 downto 0 loop
- binary_int(i) <= gray(i+1) xor gray(i);
- end loop;
- end if;
- end if;
- end process;
- -- Pipeline the output
- process(clk)
- begin
- if rising_edge(clk) then
- if rst = '1' then
- binary <= (others => '0');
- else
- binary <= binary_int;
- end if;
- end if;
- end process;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 2 sec ago | 0.15 KB
-
⭐⭐⭐Instant Profit Method⭐⭐
Java | 5 sec ago | 0.15 KB
-
📝 MAKE $2500 IN 15 MIN ✅ Working
JavaScript | 7 sec ago | 0.24 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 12 sec ago | 0.15 KB
-
⭐⭐⭐Profit Method⭐⭐
Java | 16 sec ago | 0.15 KB
-
🚀 Swapzone +37% glitch
JavaScript | 16 sec ago | 0.24 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 23 sec ago | 0.15 KB
-
💎 ChangeNOW Exploit
JavaScript | 26 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand