SHOW:
|
|
- or go back to the newest paste.
| 1 | library ieee; | |
| 2 | - | ***Single Bit*** |
| 2 | + | use ieee.std_logic_1164.all; |
| 3 | ||
| 4 | - | library IEEE; |
| 4 | + | |
| 5 | - | use IEEE.STD_LOGIC_1164.ALL; |
| 5 | + | |
| 6 | - | use IEEE.STD_LOGIC_ARITH.ALL; |
| 6 | + | port( |
| 7 | - | use IEEE.STD_LOGIC_UNSIGNED.ALL; |
| 7 | + | a: in std_logic; |
| 8 | b: in std_logic; | |
| 9 | - | -- Uncomment the following lines to use the declarations that are |
| 9 | + | S: in std_logic; |
| 10 | - | -- provided for instantiating Xilinx primitive components. |
| 10 | + | O: out std_logic |
| 11 | - | --library UNISIM; |
| 11 | + | ); |
| 12 | - | --use UNISIM.VComponents.all; |
| 12 | + | |
| 13 | ||
| 14 | - | entity ADDONE is |
| 14 | + | |
| 15 | - | Port ( a : in std_logic; |
| 15 | + | |
| 16 | - | b : in std_logic; |
| 16 | + | with S select O <= a when '0', b when '1'; |
| 17 | - | cin : in std_logic; |
| 17 | + |