Documente Academic
Documente Profesional
Documente Cultură
Verilog vs. VHDL In general, Verilog is easier to learn than VHDL. This is due, in part, to
the popularity of the C programming language, making most
Verilog and VHDL are Hardware Description languages that are used to programmers familiar with the conventions that are used in Verilog.
write programs for electronic chips. These languages are used in VHDL is a little bit more difficult to learn and program.
electronic devices that do not share a computer’s basic architecture.
VHDL is the older of the two, and is based on Ada and Pascal, thus VHDL has the advantage of having a lot more constructs that aid in
inheriting characteristics from both languages. Verilog is relatively high-level modeling, and it reflects the actual operation of the device
recent, and follows the coding methods of the C programming being programmed. Complex data types and packages are very
language. desirable when programming big and complex systems, that might
have a lot of functional parts. Verilog has no concept of packages, and
VHDL is a strongly typed language, and scripts that are not strongly all programming must be done with the simple data types that are
typed, are unable to compile. A strongly typed language like VHDL does provided by the programmer.
not allow the intermixing, or operation of variables, with different
classes. Verilog uses weak typing, which is the opposite of a strongly Lastly, Verilog lacks the library management of software programming
typed language. Another difference is the case sensitivity. Verilog is languages. This means that Verilog will not allow programmers to put
case sensitive, and would not recognize a variable if the case used is needed modules in separate files that are called during compilation.
not consistent with what it was previously. On the other hand, VHDL is Large projects on Verilog might end up in a large, and difficult to
not case sensitive, and users can freely change the case, as long as the trace, file.
characters in the name, and the order, stay the same.
Summary:
Hardware Description Language - Introduction
1. Verilog is based on C, while VHDL is based on Pascal and
Ada. • HDL is a language that describes the hardware of digital
systems in a textual form.
2. Unlike Verilog, VHDL is strongly typed. • It resembles a programming language, but is specifically
oriented to describing hardware structures and behaviors.
3. Ulike VHDL, Verilog is case sensitive. • The main difference with the traditional programming
languages is HDL’s representation of extensive parallel
operations whereas traditional ones represents mostly serial
4. Verilog is easier to learn compared to VHDL. operations.
• The most common use of a HDL is to provide an alternative to
5. Verilog has very simple data types, while VHDL allows users schematics.
to create more complex data types.
1
08-03-2018
• As a documentation language, HDL is used to represent and • A simulator interprets the HDL description and produces a
document digital systems in a form that can be read by both readable output, such as a timing diagram, that predicts
humans and computers and is suitable as an exchange how the hardware will behave before its is actually
language between designers. fabricated.
• The language content can be stored and retrieved easily and • Simulation allows the detection of functional errors in a
processed by computer software in an efficient manner. design without having to physically create the circuit.
• There are two applications of HDL processing: Simulation and
Synthesis
2
08-03-2018
Verilog
Types of HDL
• There are two standard HDL’s that are supported by IEEE. • Verilog HDL has a syntax that describes precisely the legal
– VHDL (Very-High-Speed Integrated Circuits Hardware constructs that can be used in the language.
Description Language) - Sometimes referred to as VHSIC • It uses about 100 keywords pre-defined, lowercase, identifiers
HDL, this was developed from an initiative by US. Dept. of that define the language constructs.
Defense. • Example of keywords: module, endmodule, input, output wire,
– Verilog HDL – developed by Cadence Data systems and and, or, not , etc.,
later transferred to a consortium called Open Verilog • Any text between two slashes (//) and the end of line is
International (OVI). interpreted as a comment.
• Blank spaces are ignored and names are case sensitive.
3
08-03-2018
4
08-03-2018
Bitwise operators
– Bitwise NOT : ~
– Bitwise AND: &
– Bitwise OR: |
– Bitwise XOR: ^
– Bitwise XNOR: ~^ or ^~
In the above example, cwd is declared as one instance
circuit_with_delay. (similar in concept to object<->class relationship)
5
08-03-2018
Boolean Expressions:
//Circuit specified with Boolean equations
• These are specified in Verilog HDL with a
continuous assignment statement consisting module circuit_bln (x,y,A,B,C,D);
of the keyword assign followed by a Boolean input A,B,C,D;
Expression. output x,y;
assign x = A | (B & C) | (~B & C);
• The earlier circuit can be specified using the
statement: assign y = (~B & C) | (B & ~C & ~D);
endmodule
assign x = (A&B)|~C)
E.g. x = A + BC + B’D
y = B’C + BC’D’
6
08-03-2018
Gate-Level Modeling
• The module is implemented in terms of logic gates and Gate-level modeling (2)
interconnections between these gates. Design at this level is
similar to describing a design in terms of a gate-level logic • When a primitive gate is incorporated into a
diagram. module, we say it is instantiated in the module.
• Here a circuit is specified by its logic gates and their • In general, component instantiations are
interconnections.
statements that reference lower-level
• It provides a textual description of a schematic diagram. components in the design, essentially creating
• Verilog recognizes 12 basic gates as predefined primitives. unique copies (or instances) of those components
– 4 primitive gates of 3-state type. in the higher-level module.
– Other 8 are: and, nand, or, nor, xor, xnor, not, buf • Thus, a module that uses a gate in its description
• When the gates are simulated, the system assigns a four- is said to instantiate the gate.
valued logic set to each gate – 0,1,unknown (x) and high
impedance (z)
7
08-03-2018
8
08-03-2018