Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
E2MATRIX Research Lab
Opp Phagwara Bus Stand, Backside Axis Bank,
Parmar Complex, Phagwara Punjab (India).
Contact : +91 9041262727
web: www.e2matrix.com -- email: support@e2matrix.com
Simulation tools typically accept full set of Verilog language constructs
Some language constructs and their use in a Verilog description make simulation efficient and are ignored by synthesis tools
Synthesis tools typically accept only a subset of the full Verilog language constructs
In this presentation, Verilog language constructs not supported in Synopsys FPGA Express are in red italics
There are other restrictions not detailed here, see [2].
The Module Concept
Basic design unit
Modules are:
Declared
Instantiated
Modules declarations cannot be nested
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
E2MATRIX Research Lab
Opp Phagwara Bus Stand, Backside Axis Bank,
Parmar Complex, Phagwara Punjab (India).
Contact : +91 9041262727
web: www.e2matrix.com -- email: support@e2matrix.com
Simulation tools typically accept full set of Verilog language constructs
Some language constructs and their use in a Verilog description make simulation efficient and are ignored by synthesis tools
Synthesis tools typically accept only a subset of the full Verilog language constructs
In this presentation, Verilog language constructs not supported in Synopsys FPGA Express are in red italics
There are other restrictions not detailed here, see [2].
The Module Concept
Basic design unit
Modules are:
Declared
Instantiated
Modules declarations cannot be nested
Those slides describe digital design using Verilog HDL,
starting with Design methodologies for any digital circuit then difference between s/w (C/C++) and H/w (Verilog) and the most important constructs that let us start hardware design using Verilog HDL.
Those slides describe digital design using Verilog HDL,
starting with Design methodologies for any digital circuit then difference between s/w (C/C++) and H/w (Verilog) and the most important constructs that let us start hardware design using Verilog HDL.
basics to c++ learning
Operators and Statements
Assignation (=).
Arithmetic operators
Precedence Rules of Arithmetic Operators
Compound assignation operators
Increment and decrement Operators
Relational operators
Logic operators
Type Conversion
Converting Algebraic Expressions to C++
Library Function
#include <iostream.h>
int main()
{
int first, second, sum;
cout << "Abebe: Hey Bekele, I just learned how to add”
<< “ two numbers together."<< endl;
cout << "Bekele: Cool!" <<endl;
cout << "Abebe: Give me the first number."<< endl;
cout << "Bekele: ";
cin >> first;
cout << "Abebe: Give me the second number."<< endl;
cout << "Bekele: ";
cin >> second;
sum = first + second;
cout << "Abebe: OK, here is the answer:";
cout << sum << endl;
cout << "Bekele: Wow! You are amazing!" << endl;
return 0;
4. operators in c programming by digital waveRahulSharma4566
For Video Tutorial Click on Link:
https://youtu.be/u9eSpH3NTFg
https://youtu.be/mzxYbU4t2VY
https://youtu.be/Xv5nPe2y2w8
Bitwise Operators
Advance and Basic concepts of C PRogramming
Bitwise AND, OR, XOR, NOT, RIGHT & LEFT SHIFT
What is Bitwise Operator?
What are the types of Bitwise operators?
What is the Bitwise AND operator?
What is the Bitwise OR operator?
What is Operator?
What are the types of operators?
What is the unary operator?
What are the types of unary operators?
What is Post Increment Operator
What is Pre Increment Operator?
Unary Operators
Relational Operators
Logical Operators
Digital Wave
#OperatorsinCProgramming
#typesofoperatorincprogramming
#Relational OperatorinC
# LogicalOperatorinC
# LogicalANDoperatorinc
# LogicalOROperatorinc
# LogicalXOROperator
#IntroductionofProgammingInC
03. Operators Expressions and statementsIntro C# Book
In this chapter we will get acquainted with the operators in C# and the actions they can perform on the different data types. We will explain the priorities of the operators and we will analyze the different types of operators, according to the count of the arguments they can take and the actions they can perform. In the second part we will examine the conversion of data types. We will explain when and why it is needed to be done and how to work with different data types. At the end of the chapter we will pay special attention to the expressions and how we should work with them.
At the end of this lecture students should be able to;
Define the terms operators, operands, operator precedence and associativity.
Describe operators in C programming language.
Practice the effect of different operators in C programming language.
Justify evaluation of expressions in programming.
Apply taught concepts for writing programs.
ARM PROCESSOR ARCHITECTURE with reference to ARM state and Thumb state. CPSR register and shift from one state to another ,applications of Thumb and limitations of Thumb.
https://www.youtube.com/watch?v=MW2M6hvAuis
ARM 7 TDMI Processor architecture ,with reference to Processing modes, CPSR Register organization, Privileged and Unprivileged modes are explained.
https://www.youtube.com/watch?v=8oAZEJCwZu8&t=11
8085 Microprocessor Architecture for beginners.It explains the Instruction Register(IR),Instruction Decoder, Address buffer register,Address data buffer,program execution,Serial I/O control etc.
This PPT is about the ARM processors, family of processors,significance,applications and architectural features and Instruction Set Architecture useful for beginners
This is about the 8085 Microprocessor Architecture for absolute beginners.It explains register organization , Temporary registers,General Purpose Registers ,Special Function Registers,Stack Pointer(SP),Program Counter(PC),Stack operation,PUSH, POP operation with examples.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Automobile Management System Project Report.pdfKamal Acharya
The proposed project is developed to manage the automobile in the automobile dealer company. The main module in this project is login, automobile management, customer management, sales, complaints and reports. The first module is the login. The automobile showroom owner should login to the project for usage. The username and password are verified and if it is correct, next form opens. If the username and password are not correct, it shows the error message.
When a customer search for a automobile, if the automobile is available, they will be taken to a page that shows the details of the automobile including automobile name, automobile ID, quantity, price etc. “Automobile Management System” is useful for maintaining automobiles, customers effectively and hence helps for establishing good relation between customer and automobile organization. It contains various customized modules for effectively maintaining automobiles and stock information accurately and safely.
When the automobile is sold to the customer, stock will be reduced automatically. When a new purchase is made, stock will be increased automatically. While selecting automobiles for sale, the proposed software will automatically check for total number of available stock of that particular item, if the total stock of that particular item is less than 5, software will notify the user to purchase the particular item.
Also when the user tries to sale items which are not in stock, the system will prompt the user that the stock is not enough. Customers of this system can search for a automobile; can purchase a automobile easily by selecting fast. On the other hand the stock of automobiles can be maintained perfectly by the automobile shop manager overcoming the drawbacks of existing system.
1. Digital Design Using Verilog
- For Absolute Beginners
LECTURE6 : VERILOG OPERATORS
2. Introduction
• Normally the operators work on any specific data
types or operands to give expected results.
• As Verilog is mainly used to describe the hardware
behavior and functioning, it supports a variety of
pre-defined operators .
• But it should be always remembered that not all the
operands are synthesizable.
•Some of these operators are similar to the operators
used in the C programming language.
•Each operator type is denoted by a symbol
3. contd
• The different types of Operators supported are
• Assignment operator
• Arithmetic operators
• Logical operators
• relational, equality operators
• Bitwise operators
• Reduction operators
• Shift operators
• Concatenation and Conditional etc.
4. ASSIGNMENT OPERATOR
• Verilog uses the equal sign (=) to denote an
assignment.
• The left-hand side (LHS) of the assignment is the
target signal. The right-hand side (RHS) contains the
input arguments and can contain both signals,
constants, and operators.
• Ex: Y = a & b;
• F2 = 8’hAA;
• F1 = A ;
23 June 2020 4yayavaram@yahoo.com
5. • The most fundamental operators are Arithmetic
operators.
• Broadly there are two types of arithmetic operators.
(i).Unary and (ii).Binary
Unary Operators: A unary operator is an operator that
takes a single operand in an expression or a statement.
+ : addition % : modulus
- : subtraction ** : exponentiaion
* : multiplication / : divide
23 June 2020 5yayavaram@yahoo.com
ARITHMETIC OPERATORS
6. contd
Ex: +A ; - Y ; - (A+B) ; ** D Exponential D etc.
• Binary Operators : A binary operator is an operator
that operates on two operands and manipulates them
to return a result.
• Y = (A+B) * (B+C)
• X = (A+B) / (C-D)
• D =A + D : Addition operator surrounded by two
operands
23 June 2020 6yayavaram@yahoo.com
7. Illustration
• module Arithmetic (A, B, Y1, Y2, Y3, Y4, Y5);
input [2:0] A, B;
output [3:0] Y1;
output [4:0] Y3;
output [2:0] Y2, Y4, Y5;
reg [3:0] Y1;
reg [4:0] Y3;
reg [2:0] Y2, Y4, Y5;
always @(A or B)
begin
Y1=A+B; //addition operation
Y2=A-B; //subtraction operation
Y3=A*B; //multiplication operation
Y4=A/B; //division operation
Y5=A%B; //modulus of A divided by B
end
endmodule
23 June 2020
7
yayavaram@yahoo.com
8. % Modulus operator
• The modulus operator is denoted by the symbol %.
• For example A % B, gives the remainder when the first operand is
divided by the second, and thus is zero when B divides A exactly.
• The result of a modulus operation shall take the sign of the first
operand.
23 June 2020 8yayavaram@yahoo.com
9. Logical Operator
• These operators deals with true or false logic . i.e
the logical operators return either 0 or 1.
• Logical comparison operators are used in conjuction
with relational and equality operators .
• These operators are widely used in if ; While
statements. And, provide a means to perform
multiple comparisons within a single expression.
• ! : Logical negation. Ex : ! (A && B)
&& : Logical AND
|| : Logical OR Ex : A || B
23 June 2020 9yayavaram@yahoo.com
10. contd
• Logical operators produce 1-bit results.
• The result of && is one if none of the operands is 0.
• The result of || is 1 if at least one of the operands is
non-zero.
• The ! Operator complements its operand and
produces 1 or a 0. If X or Z appears in an operand
of the logical operand ,an X will be the result.The !
Operator has the highest precedence, followed by
&& and || .
23 June 2020 10yayavaram@yahoo.com
11. Examples
• Let A = 3’b101 ; B = 3’b000; C = 3’B01X
• !A = 1b0 ;
• !B = 1’b1 ;
• !C = 1’Bx
• A && B => 1’b 0 ; // since one operand is zero
• B&&C=> 1’bX;// one operand is unknown
• A || B => 1’b1 // one of the operands is non-zero
• B || C => 1’bX
23 June 2020 11yayavaram@yahoo.com
12. Example-2
• module ex_logical (A, B, C, D, E, F, Y);
input [2:0] A, B, C, D, E, F;
output Y;
reg Y;
always @ (A or B or C or D or E or F)
begin
if ((A= =B) && ((C>D) || !(E<F)))
Y=1;
else
Y=0;
end
endmodule
23 June 2020 12yayavaram@yahoo.com
13. Relational & Equality Operators
• These operators are mainly used to compare data
values.
• = = Equality ; != Not equal(Inequality)
• = = = : Case equality ; ! = = Case inequality.
• >= Greater or equal ; <= Less than or equal
• > Greater ; < Less
• Here = = ; ! = ; = = = are the equality operators
• Case equality is used to compare the values with x
or z.
23 June 2020 13yayavaram@yahoo.com
14. Example for Case Equality
• Let A = 1011; B = 1011
A = =B ; The result is true;
• Let A = 0110 ; B = 1011;
A == B ; The result is false ,as they are not equal.
• Suppose A= 101X ; B = 101X ;
• A ==B ; The result is unknown x
So, One has to use case Equality operator. In a case equality
A = = = B ; The result is 1 (true).
• Suppose A=101X & B= 011X.The the result will be False
i.e 0.
23 June 2020 14yayavaram@yahoo.com
15. Illustration
• module ex_relational (A, B, Y1, Y2, Y3, Y4);
input [2:0] A, B;
output Y1, Y2, Y3, Y4;
reg Y1, Y2, Y3, Y4;
always @(A or B)
begin
Y1=A<B;//less than
Y2=A<=B;//less than or equal to
Y3=A>B;//greater than
if (A>B)
Y4=1;
else
Y4=0;
end
endmodule
23 June 2020 15yayavaram@yahoo.com
16. Illustration-Equality operators
• module ex_equality (a, b, y1, y2, y3);
input [2:0] a,b;
output y1,y2;
output [2:0] y3;
reg y1,y2;
reg [2:0] y3;
always @(a or b)
begin
y1= a= =b;// y1=1 if a equivalent to b
y2=a!=b;//y2=1 if a not equivalent to b
if (a= =b) //
y3= a;
else
y3= b;
end
endmodule
23 June 2020 16yayavaram@yahoo.com
17. Bitwise Operators
• Verilog bitwise operators can be either unary or
binary. Result is always the size of largest operand.
• i.e the meaning is , logical bit-wise operators take
two single or multiple operands on either side of the
operator and return a single bit result.
• The only exception is the NOT operator, which
negates the single operand that follows.
• Verilog does not have the equivalent of NAND or
NOR operator, their function is implemented by
negating the AND and OR operators.
23 June 2020 17yayavaram@yahoo.com
18. contd
• ~ : bitwise NOT(Invert)
• & : bit wise AND
• | : bitwise OR
• ^ : bitwise Exclusive OR
• ~ ^ : bitwise exclusive NOR
• Bit wise operators operate on each bit and returns a
value that is also a bit.
23 June 2020 18yayavaram@yahoo.com
19. Bitwise Operators contd
• If two operands are unequal ,the smaller one is left
extended by adding zeros.
• Ex : a = 4’b1001 and b = 3’b 101.
To find a & b , the second operand is taken as
b = 4’b0101 and then logical & operation is
performed.
a & b => 4’b0001
The size of the result is 4 bits .
23 June 2020 19yayavaram@yahoo.com
20. Examples
• assign a => 4’b1011 ; b=> 4’b1101 ; c => 4’b0111;
• ~ a => 4’b 0100 ; ~b=> 4’b0010 ; ~c => 4’b1000;
• a & b => 4’b1001 ; b & c => 4’b 0101
• a | b => 4’b1111 ; b | c => 4’b1111
• a ^ b => 4’b 0110 ; b ^ c => 4’b 1010
• a ^ ~b => 4’b 1001 ; b ^ ~ c => 4’b 0101
23 June 2020 20yayavaram@yahoo.com
21. Example-2
• module ex_Bitwise (A, B, Y);
input [6:0] A;
input [5:0] B;
output [6:0] Y;
reg [6:0] Y;
always @(A or B)
begin
Y(0)=A(0)&B(0); // binary AND
Y(1)=A(1)|B(1); // binary OR
Y(2)=!(A(2)&B(2)); // negated AND (NAND)
Y(3)=!(A(3)|B(3)); // negated OR (NOR)
Y(4)=A(4)^B(4); // binary XOR
Y(5)=A(5)~^B(5); // binary XNOR
Y(6)=!A(6); // unary negation
end
endmodule
23 June 2020 21yayavaram@yahoo.com
22. Reduction Operators
• Reduces a vector to a single bit value. i.e a multibit
value is reduced to a single bit value.
• Majority of the times this is a unary operator.
• To say in terms of hardware , This reduction
operator works like a multiple input bits logic
gate,which accepts a single word operand and
produces a single bit as output.
• The operators are
• & and ; ~ & not and(nand) ; | or ; ~ | not or (nor)
• ^ x-or ; ~ ^ not or (x-nor)
23 June 2020 22yayavaram@yahoo.com
23. Examples
• For ex, in the ‘and’ gate for
the Inputs 1011 the output is 0.
• Similarly let us consider or gate as shown below.
• So, these reduction operands are reducing a multibit
operands into single bit operands.
• s.23 June 2020 23yayavaram@yahoo.com
24. Examples contd
• Let us consider the x-or gate .
• y = ^ A where A = 4’b0110
i.e y = 0 ^1^1^0 = 1
23 June 2020 24yayavaram@yahoo.com
26. SHIFT OPERATORS
• Generally ,the shift operators are used to shift the
operand bits either left or right.
• Shift operators require two operands. The operand
before the operator contains data to be shifted and
the operand after the operator contains the
number of single bit shift operations to be
performed.
• Verilog has two types of shift operators .
• i. Logical Shift and ii.Arithmetic shift operators.
23 June 2020 26yayavaram@yahoo.com
27. • This shifting is done in two ways. Either Left shift
or Right shift.
• Logical Right shift operator is denoted by >>
• Logical Left shift operator is <<.
• In logical shift vacated positions are always filled
with zero(0).
• In terms of the operation right shift means divide by
2 also.
• Similarly Left shift operation will result in multiply
of the operand by 2.
23 June 2020 27yayavaram@yahoo.com
contd
28. Arithmetic Shift Operators
• Right arithmetic shift is denoted by the symbol >>>
• Left arithmetic shift is denoted by <<<.
• In arithmetic shift: For signed numbers , the vacated
position is filled with sign bit value(MSB bit)
• For unsigned ,the vacated positions are filled with
zero.
23 June 2020 28yayavaram@yahoo.com
29. Code-Example
• module ex_shift (a, y1, y2);
input [7:0] a;
output [7:0] y1, y2;
parameter b=3; reg [7:0] y1, y2;
always @(a)
begin
y1=a<<b; //logical shift left
y2=a>>b; //logical shift right
end
• endmodule
23 June 2020 29yayavaram@yahoo.com
30. Concatenation Operator{,}
• The concatenation operator "{ , }" combines or
(concatenates) the bits of two or more data objects.
• The objects may be scalar (single bit) or vectored (muliple
bit).
• Mutiple concatenations may be performed with a constant
prefix and is known as replication.
• For ex: By concatenating two 4-bit operands, an 8-bit
operand is formed.
• Remember it is not direct arithmetic addition.
• Ex: Let A= 4’b1011; B=4’b 1010;
assign y = {a,b} gives y=> 8b’10111010
23 June 2020 30yayavaram@yahoo.com
31. Replicate Operator
• It replicates the operand for a specified number of
times.( or copied specified number of times).
• For ex: assign y = {3{3’b110}} results in
• y = 9’b110110110
23 June 2020 31yayavaram@yahoo.com
32. Conditional Operator(?)
• An expression using conditional operator evaluates
the logical expression before the "?".
• If the expression is true then the expression before
the colon (:) is evaluated and assigned to the output.
• If the logical expression is false then the expression
after the colon is evaluated and assigned to the
output.
23 June 2020 32yayavaram@yahoo.com
33. Example code
• To understand the Conditional operator lets consider
the 2:1 Mux example.
Ex: module mymux2_1(A,B,S,Y);
output Y;
input A,B,S;
assign Y= S ? B:A;
endmodule
Note: In the above ,first the ‘S’ is tested .If it is
true,then Y= B else Y = A
23 June 2020 33yayavaram@yahoo.com