Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2K views

Half Subtractor VHDL Code Using Dataflow Modeling

The document describes a VHDL code for a half subtractor circuit using a data flow modeling approach. It defines the entity with two inputs (a and b) and two outputs (diff and borrow). The architecture uses concurrent statements to assign the output signals based on the Boolean logic expressions for half subtraction - with diff assigned as the XOR of the inputs and borrow assigned as the AND of the inverted first input and the second input. It also references test benches and waveforms that could be used to simulate and verify the half subtractor design.

Uploaded by

OP2R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Half Subtractor VHDL Code Using Dataflow Modeling

The document describes a VHDL code for a half subtractor circuit using a data flow modeling approach. It defines the entity with two inputs (a and b) and two outputs (diff and borrow). The architecture uses concurrent statements to assign the output signals based on the Boolean logic expressions for half subtraction - with diff assigned as the XOR of the inputs and borrow assigned as the AND of the inverted first input and the second input. It also references test benches and waveforms that could be used to simulate and verify the half subtractor design.

Uploaded by

OP2R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

INFOOP2R.WIX.

COM/OP2R

HALF SUBTRACTOR VHDL CODE USING DATA FLOW MODELING

Library declaration library IEEE; use IEEE.STD_LOGIC_1164.ALL; --------------------------------------------

Std_logic_1164; package for std_logic (predefined data types).

entity half_subtractor is Port ( a, b: in STD_LOGIC; diff ,borrow: out STD_LOGIC); end half_subtractor; --------------------------------------------architecture Behavioral of half_subtractor is begin ---------------------------------------------sum<= a xor b; carry<= ((not a) and b); ---------------------------------------------and Behavioral;

Entity declaration. a, b: - input port bits (bits to be added) Sum, carry: - output port bits

Concurrent statement of half adder circuit. These are the circuit expressions which are formed by k-map or Boolean function.

RTL VIEW:-

OUT PUT WAVEFORMS:-

INFOOP2R.WIX.COM/OP2R

You might also like