From The Compiler, 10 Years ago, written in VHDL.
Embed
  1. -- Florian Bruhin
  2. -- Bildungszentrum Uster
  3. -- 22.05.2012
  4. -- RSFF.vhdl - RS-Flipflop
  5.  
  6. library ieee;
  7. use ieee.std_logic_1164.all;
  8.  
  9. entity RSFF is
  10.     port (
  11.         nSet, nRes: in  std_logic;
  12.         Q, nQ: out std_logic
  13.     );
  14. end entity;
  15.  
  16. architecture RSFF_behave of RSFF is
  17.     signal hQ, hnQ: std_logic;
  18.  
  19.     begin
  20.  
  21.     hQ  <= (nSet nand hnQ);
  22.     hnQ <= (nRes nand hQ);
  23.     Q   <= hQ;
  24.     nQ  <= hnQ;  
  25.  
  26.     --          .---.
  27.     --          |   |
  28.     -- nSet --+-| & |o-+----- Q
  29.     --        +-|   |  |
  30.     --        | '---' /
  31.     --         \     /
  32.     --          \   / hQ
  33.     --           \ /
  34.     --            X
  35.     --           / \
  36.     --          /   \ hnQ
  37.     --         /     \
  38.     --        | .---. \
  39.     --        +-|   |  |
  40.     -- nRes --+-| & |o-+----- nQ
  41.     --          |   |
  42.     --          '---'
  43.  
  44. end architecture;