File: sm.vhdl

package info (click to toggle)
alliance 5.0-20120515-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 70,180 kB
  • sloc: ansic: 350,295; vhdl: 34,227; yacc: 27,122; sh: 12,416; cpp: 9,478; makefile: 7,055; lex: 3,684
file content (24 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library IEEE;
use IEEE.std_logic_1164.all;

entity Sm is  -- subtractor multiplexor 
  port ( x  : in  std_logic;
         y  : in  std_logic;
         b  : in  std_logic;
         u  : in  std_logic;
         d  : out std_logic;
         bo : out std_logic);
end Sm;

architecture circuits of Sm is
  signal t011, t111, t010, t001, t100, td : std_logic;
begin  -- circuits of Sm
  t011 <= (not x) and y and b;
  t111 <= x and y and b;
  t010 <= (not x) and y and (not b);
  t001 <= (not x) and (not y) and b;
  t100 <= x and (not y) and (not b);
  bo   <= t011 or t111 or t010 or t001;
  td   <= t100 or t001 or t010 or t111;
  d    <= td when u='1' else x;  
end circuits;  -- of Sm