CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - LookUpTable
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - LookUpTable - List
[
VHDL-FPGA-Verilog
]
4v2
DL : 0
ENTITY maj IS PORT(a,b,c : IN BIT m : OUT BIT) END maj --Dataflow style architecture --Behavioural style architecture using a look-up table ARCHITECTURE using_table OF maj IS BEGIN PROCESS(a,b,c) CONSTANT lookuptable : BIT_VECTOR(0 TO 7) := "00010111" VARIABLE index : NATURAL BEGIN index := 0 --index must be cleared each time process executes IF a = 1 THEN index := index + 1 END IF IF b = 1 THEN index := index + 2 END IF IF c = 1 THEN index := index + 4 END IF m <= lookuptable(index) END PROCESS END using_table ------------------3,5,6,7 is 1 so 110 101 011 111 is 1-ENTITY maj IS PORT(a,b,c : IN BIT m : OUT BIT) END maj --Dataflow style architecture --Behavioural style architecture using a look-up table ARCHITECTURE using_table OF maj IS BEGIN PROCESS(a,b,c) CONSTANT lookuptable : BIT_VECTOR(0 TO 7) := "00010111" VARIABLE index : NATURAL BEGIN index := 0 --index must be cleared each time process executes IF a = 1 THEN index := index+ 1 END IF IF b = 1 THEN index := index+ 2 END IF IF c = 1 THEN index := index+ 4 END IF m <= lookuptable(index) END PROCESS END using_table ------------------3,5,6,7 is 1 so 110 101 011 111 is 1
Date
: 2026-01-02
Size
: 134kb
User
:
赵中原
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.