ONLINE PLATFORM FOR PROGRAMMING AND RESEARCH (OP2R)
ONES COMPLEMENT VHDL CODE USING STRUCTURAL MODELING
Library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
Std_logic_1164. package for std_logic (predefined data types).
-----------------------------------------------------------------entity ones_comp is
Port (a : in STD_LOGIC_VECTOR (3 downto 0);
y : out STD_LOGIC_VECTOR (3 downto 0));
end ones_comp;
-----------------------------------------------------------------architecture Behavioral_1scomp of ones_comp is
---------------------------------------------begin
y<= not a;
---------------------------------------------end Behavioral_1scomp;
RTL VIEW:-
[Link]/OP2R
OUT PUT WAVEFORMS:-
Entity declaration.
a: - input port bits.
y: - output port bits.(1s complement
of input bits).
Concurrent statements.
Expression for 2s complement circuit that are
calculated using k-map and Boolean function.