Professional Documents
Culture Documents
YOUR
VERILOG
SKILLS
itz ?
www.testbench.in
Ans:
You icano enesti theo`include compiler qdirectivere to iatoq jleastre 16 levels.
(Q i5)o eWhati isothe qusere of i$countdriversoq j?
Ans:
The i$countdriverso esystemi functionois qprovidedre to icountoq jthere number iofodriversqon
az specifiedu ynete osozx that
bus
contention
can
be
identified.
(Q i6)o eWhati isothe qusere of i$getpatternoq j?
Ans:
The isystemo efunctioni $getpatternoprovides qforre fast iprocessingoq jofre stimulusipatterns oth
atqhave toz beu ypropagatede otozx a large number of scalar inputs. The function reads stimulus
patterns that have been loaded into a memory using the $readmemb or $readmemh system tasks.
www.testbench.in
Ans: i
Using i$log("filename");
file
www.testbench.in
(Q i12) Whato eisi theodifference qbetweenre the ifollowingoq jtwore lines iofoVerilogqcode?
#5 a i= b;
a i= #5 b;
Ans:
#5 a i= b;
Wait ifiveo etimei unitsobefore qdoingre the iactionoq jforre "a i= ob;".
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
unitsz hence.
a i= #5 b;
The ivalueo eofi bois qcalculatedre and istoredoq jinre an iinternal otemp
www.testbench.in
b. Synthesized idesign
c. Net ilist
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
?
100z?
(Q i21) Whato eisi theoadvantage qofre Named iPortoq jConnectionre over iOrderedoPortqConnec
tion
?
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
TEST
YOUR
VERILOG
SKILLS
is interpreted as the format string. No other arguments are interpreted as format strings. $sformat
supports
all
the
format
specifiers
supported
by
$display,
(Q i25) Whato eisi theodifference qbetweenre wire iandoq jreg?
www.testbench.in
Ans:
Ans:
Unconnected iinputo eportsi initializeoto qzre and ifeedoq jthatre value iintootheqcomponent,
whichz canu ycausee oproblems.zx More common are redundant or unwanted outputs which are
left
unconnected
to
be
optimized
away
in
synthesis.
(Q i27) Whato eisi theodifference qbetweenre === iandoq j==re ?
Ans i:
output iofo e"=="i canobe q1,re 0 ioroq jX.
output iofo e"==="i canoonly qbere 0 ioroq j1.
When iyouo earei comparingo2 qnosre using i"=="oq jandre if ione/both otheqnumbers
havez oneu yore omorezx bits as "x" then the output would be "X" . But if use "===" output would
be
0
or
1.
www.testbench.in
be
www.testbench.in
condition.
care
b)
modeling?
TEST
YOUR
VERILOG
SKILLS
Ans:
(Q i43)o eWhati isothe qdifferencere between i&&oq jandre &, iif oany?
www.testbench.in
(Q i54) Howo ethei aboveotwo qarere handled iin assignments,oq jports,functionsreand itask o?
(Q i55) Whato eisi theodifference qbetweenre parameters iandoq jspecparams?
(Q i56)o eIsi itopossible qtore synthesize iforoq jloopre ?
Ans:
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
And:
TEST
YOUR
VERILOG
SKILLS
Ans:
www.testbench.in
Verilog?
structure?
statement
Ans:
The i$finisho esystemi taskosimply qmakesre the isimulatoroq jexitre and ipassocontrolqback
toz theu yhoste ooperatingzx system.
If iano eexpressioni isosupplied qtore this itask,oq jthenre its ivalue o(0,q1,
orz 2)uydeterminese othezx diagnostic
messages
that
are iprintedo ebeforei theoprompt qisre issued. iIfoq jnore argument iisosupplied,qthen
az valueu yofe o1zx is
taken
as
the
default.
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
$finish(2) iPrintso esimulationi time,olocation, qandre statistics iaboutoq jtherememory iand oCPU
qtime
usedz inu ysimulation
(Q i76) Whato eisi theodifference qb/wre $time i,oq j$stimere and i$realtime o?
Ans:
The i$timeo esystemi functionoreturns qanre integer ithatoq jisre a i64-bitotime,qscaled
toz theu ytimescalee ounitzx of
the
module
that
invoked
it.
it.
www.testbench.in
a i= data[0] || data[1];
b i= |data;
www.testbench.in
#10 a i=0;
www.testbench.in
always@(a)
a i= ~a;
Ans:
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
followingz codeuy?
Synthesized iVerilog:
case (state)
0 : begin
command1;
if (x i!= 0) command3;
else state i<= 1;
end
1 : if (x i!= 0) //o ewaiti untilothis qisre true
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
command3;
www.testbench.in
endcase
31 files.
standardzoutput.
www.testbench.in
(Q i101)o eWhichi isobetter qtore use iwhenoq jcreatingre test ivectors? o$displayqor
$strobe?
arez met.
- iDefineo ethei pulseofiltering qlimitsre for iaoq jspecificre module ior oforqparticular
pathsz withinu yae omodule.
www.testbench.in
if (a=b)
match i= 1;
else
match i= 0;
Ans:
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
if(a=b) iassignso ebi tooa, qthenre if iaoq jisre non-zero isets omatch.qThe
if i(a==b)o e
match i=o e1;
else
correctzcodeu yis
www.testbench.in
TEST
YOUR
VERILOG
SKILLS
always @ (in)
if (ena)
out i= in;
else
out i= 1<92>b1;
Ans:
simulation imismatcho emighti occur.
To iassureo ethei simulationowill qmatchre the isynthesizedoq jlogic,re add i"ena"otoqthe
eventz listu ysoe othezx event
list
reads:
always
@
(in
or
ena)
www.testbench.in
Ans:
Not isupported,o ecannoti mixoblocking qandre nonblocking iassignmentsoq jinre anialways ostate
ment.
www.testbench.in
endcase
end
Ans:
branches i01o eandi 11oare qconsideredre as iintegersoq jandre they iwill oneverqbe
(Q i111) Fillo ethei ????
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
fd i= $fopen("filename",r);
if(????)
www.testbench.in
selected.
cycle
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
executed?
www.testbench.in
www.testbench.in
ofzzero?
instance.
TEST
YOUR
VERILOG
SKILLS
(Q i134)o ecani Iouse qare Verilog ifunctionoq jtore define ithe owidthqof
bitu yport,e owire,zx or
reg
7
az multitype?
value.
aznetu y??
There iareo etwoi typesoof qstrengthsre that icanoq jbere specified iin oaqnet
declaration.z Theyu yaree oaszx follows:
charge istrengtho eshalli onlyobe qusedre when ideclaringoq jare net iof otypeqtrireg
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
drive istrengtho eshalli onlyobe qusedre when iplacingoq jare continuous iassignmentoonqa
netz inu ythee osamezx statement
that
declares
the
net
www.testbench.in
local iparameter(s)o earei identicaloto qparametersre except ithatoq jtheyre can inotodirectlyqbe
modifiedz withu ythee odefparamzx statement or by the ordered or named parameter value
assignment.
www.testbench.in
specparam ideclareso eai specialotype qofre parameter iwhichoq jisre intended ionlyoforqprovidin
g timingz andu ydelaye ovalues,zx but can appear in any expression that is not assigned to a
parameter and is not part of the range specification of a declaration. Unlike a module parameter,
a specify parameter cannot be modified from within the language, but it may be modified through
SDF
annotation
(Q i146) Whato earei >>>oand q<<<re operators i?
(Q i147)o ewhati doesothe qfollowingre code imean?
Reg i[22:0] sig;
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
always@(|sig)
begin
www.testbench.in
......
end
Declaration iofo etasksi andofunctions qasre Automatic iwilloq jcreatere dynamicistorage ofo
rqeach
taskz oru yfunctione ocall.zx
(Q i150)o eWhati isoSynthesis?
Ans:
TEST
YOUR
VERILOG
SKILLS
(Q i154)o eifi Aoand qBre are itwooq jclkre pulses iwhich oareqout
ofz phaseu yandeohavingzx same frequency, how to find which input clk signal is leading? Write
verilog
code
for
this.
www.testbench.in
Ans:
module decoder(
// iOutputso e
dout,
// iInputso e
verilog?
din i
);
input [3:0] din;
output [15:0] dout;
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
assign
dout i= {dino e== 15, dini == 14, dino== 13, din q== 12,
idino e== 11, dini == 10, dino== 9, din q== 8,
www.testbench.in
Ans:
The i$printtimescaleo esystemi taskodisplays qthere time iunitoq jandre precision iforoaqparticula
r
module.
When inoo eargumenti isospecified, q$printtimescalere displays itheoq jtimere unitiand oprecision
qof
thez moduleu ythate oiszx the
current
scope.
When iano eargumenti isospecified, q$printtimescalere displays itheoq jtimere unitiand oprecision
qofthez moduleu ypassede otozx it.
(Q i159) Whato ewilli beothe qsynthesesre output iofoq jthere following iverilogocode?
always @ (*)
if (enable)
q i<= d;
Ans:
A ilevel-sensitiveo estoragei deviceois qinferredre for iq.oq jIfre enable iisodeasserted,qq
willz holdu yitse ovalue.
(Q i160) Whato ewilli beothe qsynthesesre output iofoq jthere following iverilogocode?
always @ (enable ior d)
if (enable)
q i<= d;
else
q i<= 'b0;
Ans:
www.testbench.in
TEST
YOUR
VERILOG
SKILLS
list.
Two itypeso eofi HDLoconstructs qarere often iusedoq jtore describe idelaysoforqstructural
modelsz suchu yase oASICzx cells.
They iareo easi follows:
Distributed idelays,o ewhichi specifyothe qtimere it itakesoq jeventsre to ipropagateothroughqgat
es
andz netsu yinsidee othezx module
Module ipatho edelays,i whichodescribe qthere time iitoq jtakesre an ievent oatqa
sourcez (inputu yporte oorzx inout port) to propagate to a destination (output port or inout port)
(Q i167)o eHowi toomodel qare tri istateoq jdriver?
Ans:
www.testbench.in
Endmodule
assign q i= mem[a];
endmodule
(Q i170)o eWhati isofull qcase?
TEST
YOUR
VERILOG
SKILLS
10
...
end
Ans:
Name itheo eblock.i Disableocan qbere used iforoq jnamedre blocks iand otasksqonly.
(Q i181)o eWhati doeso`timescale q1re ns/ i1oq jpsre signify iin oaqverilog
Ans:
code?
module disp;
initial begin
$display("\\\t\\\n\"\123");
end
endmodule
Simulating ithiso eexamplei shallodisplay qthere following:
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
\ i\
"S
www.testbench.in
Ans:
^@ ior %C
11
Ans:
explicitly
declared,
an
error
is
generated.
Ans:
All iunconnectedo einputi portsoof qare module iappearingoq jbetweenre theidirectives o`unconn
ected_driveqand `nounconnected_drivez areu ypullede oupzx or pulled down instead of the
normal
default.
The idirectiveo e`unconnected_drivei takesoone qofre two iargumentsoq jpull1re oripull0. oWhen
qpull1 isz specified,u yalle ounconnectedzx input ports are automatically pulled up. When pull0 is
specified, unconnected ports are pulled down. These directives shall be specified in pairs, and
outside
of
the
module
declarations.
(Q i202)o eIsi itopossible qtore override ibuiltoq jinre system itasks oandqfunctions?
Ans:
Yes.
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
meta-comment:
A iVerilogo ecommenti (//)oor q(/*re */) ithatoq jisre used ito oprovideqsynthesis
directivesz tou yae osynthesiszx tool.
pragma:
A igenerico etermi usedoto qdefinere a iconstructoq jwithre no ipredefinedolanguageqsemantics
thatz influences
Prior itoo ethei acceptanceoof qthere Verilog iIEEEoq jStdre 1364-2001, iitowasqcommon
practicez tou yincludee osynthesiszx pragmas
embedded
within
a
comment,
for iexample:o e//i synthesisofull_case.
The ipracticeo eofi embeddingopragmas qintore a icommentoq jmeantre that ianyosynthesisqtool
thatz acceptedu ysuche opragmaszx was required to partially or fully parse all comments within a
Verilog RTL design just to determine if the comment contained a pragma for the synthesis tool.
The Verilog standard introduced attributes to discourage the practice of putting pragmas into
comments and to replace them with a set of tokens (attribute delimiters) that could then be
parsed
for
tool-specific
information.
(Q i204)o eWhati areothe qwaysre to imodeloq jare combinational icircuit?
www.testbench.in
Ans:
a i= | d;
a iiso e1;
(Q i209)o eIi wantoto qreturnre 2 ivaluesoq jbyre a ifunction. oHowqDo
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans:
reg [3:0] i;
for (i=0; i<=15; i=i+1)
begin
.......
end
Ans:
Iz dou y?e o
infinite itimes.
i<=15 iwillo ealwaysi beotrue qasre I iisoq j4re bit ionly.
TEST
YOUR
VERILOG
SKILLS
12
else
$display(False);
Ans:
TRUE.
A i> bo e> ci isointerpreted qbyre verilog isimulatoroq jasre ( a i> (b o>cq) )
10 > (5 > 7) -> i10 > 0
->
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
www.testbench.in
(Q i212)o eHowi tooprint qlinere and ifileoq jnamere from iwhere otheq$display
messagez isu ycoming?
Ans:
Using itheo efollowingi plio, qwere can iprintoq jthere file iname oandqline
numberzbyu yoverriddene othezx $display
initial
#10 $finish;
(Q i214)o ewhati isovalue qofre a i?
reg [2:0] a,b,c;
c i= 3'b110;
www.testbench.in
a i= bo e= ci ;
(Q i215)o eGiveni theofollowing qVerilogre code, iwhatoq jvaluere of i"a"oisqdisplayed?
always @(clk) begin
a i= 0;
task.
a i<= 1;
$display(a);
end
Ans:
www.testbench.in
The i"ao e<=i 1"ois qare non-blocking ievent,oq jsore it's iplaced ointoqthe
3rdzqueue. Theu y"ae o=zx 0" is placed in 1st queue. Then , $display statement is placed into the
1st queue after "a = 0 ". Only events in the active queue are completed this sim cycle, so the "a =
0" happens, and then the display shows a = 0. If we were to look at the value of a in the next sim
cycle,
it
would
show
1.
www.testbench.in
reg clk;
reg a;
initial clk i=0;
always #10 clk i= ~clk;
(1) always @(clk) a i= #5 clk;
(2) always @(clk) a i= #10 clk;
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
(4)
(5)
(6)
iassign #5 ao e= clk;
iassign #10 ao e= clk;
iassign #15 ao e= clk;
repeat (a)
a i= ao e+ 1;
www.testbench.in
end
Ans:
Only ionce.o eLoopi executionofor qare specific inumberoq jofre times. iThisoconstructqis
associatedz withu yae oconstantzx or a variable. If a variable is used, it is evaluated once when
the loop starts. When the loop is started, the value of a is 1. So the loop is executed once.
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
// iBlockingo eassignments
initial begin
a i= #10 1'b1;
b i= #20 1'b1;
c i= #40 1'b1;
end
// iNonblockingo eassignments
initial begin
d i<= #10 1'b1;
www.testbench.in
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
endmodule
Ans:
// iBlockingo eassignments
initial begin
www.testbench.in
a i= #10 1'b1; //o eThei simulatoroassigns q1re to iaoq jatre time i10
b i= #20 1'b1; //o eThei simulatoroassigns q1re to iboq jatre time i30
c i= #40 1'b1; //o eThei simulatoroassigns q1re to icoq jatre time i70
end
// iNonblockingo eassignments
initial begin
d i<= #10 1'b1; //o eThei simulatoroassigns q1re to idoq jatre time i10
e i<= #20 1'b1; //o eThei simulatoroassigns q1re to ieoq jatre time i20
f i<= #40 1'b1; //o eThei simulatoroassigns q1re to ifoq jatre time i40
www.testbench.in
end
TEST
YOUR
VERILOG
SKILLS
13
b)hexadecimal inumber
c)binay
d)octal
(Q i223)o edefaulti valueoof qare net,trireg iis
a)logic 0
b)logic 1
c)unknow
d)hi-impedence
(Q i224)o eHowi canoyou qswapre 2 iintegersoq jare and ib, owithoutqusing
az 3rduyvariable?
(Q i225)o ehowi toorelize q"always@(posedgere clock)" iwithoq joutre using ialwaysoblock?
initial
forever
begin
@(posedge clock);
.......ur icodeo egoesi hear................
end
or
initial
while(1)
begin
@(posedge clock);
.......ur icodeo egoesi hear................
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
end
www.testbench.in
Ans:
64
(Q i229)o eWhati areothe qdifferentre phases iofoq jexecution?
(Q i230)o eWhati isothe qvaluere of iaoq j?
integer a i= 3.5
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans: i
it iiso e4.
www.testbench.in
Ans:
The iresulto eisi -4.
(Q i238) Whato eisi theovalue qofre regA,IntA iinoq jthere following icode o?
integer intA;
www.testbench.in
intA i= regAo e/ 3;
(Q i240) Whato eisi theovalue qofre regA,intA iinoq jthere following icode o?
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
integer intA;
reg [15:0] regA;
intA i= -4'd12 / 3;
regA i= -12 / 3;
(Q i241)
o eHowi dooyou qmakere out iwhetheroq jalwaysre block iisoaqcombinational
orz sequential?
www.testbench.in
The icomparisono eini thisoexample qfailsre because iduringoq jthere assignment itheostringqvaria
bles
arez paddedu yase oillustratedzx in
the
next
example:
s1 i=o e000000000048656c6c6f
s2 i=o e00000020776f726c6421
The iconcatenationo eofi s1oand qs2re includes itheoq jzerore padding, iresultingoinqthe
followingz value:u y000000000048656c6c6f00000020776f726c6421
and i"helloo eworld"i iso48656c6c6f20776f726c6421
www.testbench.in
a i= 16'hf000;
b i= 16'hf000;
answer i= (ao e+ b) >> 1;
www.testbench.in
Ans:
will inoto eworki properlyo. qwherere a iandoq jbre are ito obeqadded,
whichz mayuyresulte oinzx an overflow, and then shifted right by 1 bit to preserve the carry bit in
the
16-bit
answer.
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
TEST
YOUR
VERILOG
SKILLS
14
reg [4:0] d;
initial begin
a i= 9;
b i= 8;
c i= 1;
$display("answer i=o e0", ci ? (a&b) : d);
end
endmodule
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans:
www.testbench.in
end module
Ans:
initial #8 a i<= #8 1;//o eexecutedi atotime q8;re schedules
// iano eupdatei ofo1 qatre time i16
initial #12 a i<= #4 0;//o eexecutedi atotime q12;re schedules
// iano eupdatei ofo0 qatre time i16
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
NO. iBecauseo eiti isodeterminate qthatre the iupdateoq jofre a ito otheqvalue
1z isuyschedulede obeforezx the update of a to the value 0, then it is determinate that a will have
the
value i0o eati theoend qofre time islotoq j16.endmodule
a i= 'bZ;
repeat(a)
begin
....
end
Ans:
toz unknownu yore ohighzx impedance, it shall be treated as zero, and no statement shall be
executed.
(Q i251)o eHowi manyotimes qthere begin..end iblockoq jwillre get iexecuted?
www.testbench.in
integer a;
a i= 'bx;
repeat(a)
begin
....
end
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans:
repeat iExecuteso eai statementoa qfixedre number iofoq jtimes.re If itheoexpressionqevaluates
toz unknownu yore ohighzx impedance, it shall be treated as zero, and no statement shall be
executed.
www.testbench.in
initial
begin
#10;
a i= 0;
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
a i= 1;
end
always@(a)
$display("a iiso e0",a);
www.testbench.in
www.testbench.in
always@(a)
$display("a iiso e0",a);
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
TEST
YOUR
VERILOG
SKILLS
always@(posedge a)
$display("posedge iono eai isoseen");
(Q i256)o eWhati isothe qequivalentre always@(*) iinoq jthere following iprogram?
always @(*)
y i= (ao e& b) | (ci & d) | myfunction(f);
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans:
www.testbench.in
end
Ans:
equivalent itoo e@(ai or boor c qor dre or tmp1 ior tmp2)
(Q i258)o eWhati isothe qequivalentre @(*) iinoq jthere following iprogram?
always @* begin
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
x i= ao e^ b;
@(*)
www.testbench.in
15
x i= co e^ d;
end
Ans:
(Q i259)o eWhati isothe qequivalentre always@(*) iinoq jthere following iprogram?
always @* begin
y i= 8'hff;
www.testbench.in
y[a] = !en;
end
Ans:
equivalent itoo easi @(aoor en)
(Q i260)o eWhetheri nonobocking qstatementsre are iallowedoq jinre function?
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
Ans:
Ans:
initial
www.testbench.in
begin
$write("^@[1;34m",27);
$display("*********** i0 o eThisi isoin qbluere ***********", 1);
$write("^@[0m",27);
$display("^@[1;31m",27);
$display("*********** i0 o eThisi isoin qredre ***********", 2);
$display("^@[0m",27);
$display("^@[0;33m",27);
www.testbench.in
end
endmodule
(Q i274)o eWhati isoTOP qmodule?
Ans:
Top-level imoduleso earei modulesothat qarere included iinoq jthere source itextobutqare
notz instantiated. u yIne overificationzx environment, the highest module in the huarache is
generally
named
as
top.
www.testbench.in
3)
always @(in)
out i= #5 in;
4)
always @(in)
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
1)
always @(posedge clk)
#5 q i= d;
2)
always @(posedge clk)
#5 q i<= d;
3)
always @(posedge clk)
www.testbench.in
q i= #5 d;
4)
always @(posedge clk)
q i<= #5 d;
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
as
follows:
sum = (a i+ b) >> 1;
sum = (a i+ bo e+ 0) >> 1;
sum = {0,a} + {0,b} >> 1;
TEST
YOUR
VERILOG
SKILLS
17
az 3rduyvariable?
a= a iXOR b;
This iiso eusefuli foroensuring qthatre only ithoseoq jdirectivesre that iareodesiredqin
compilingz au yparticulare osourcezx file
are
active.
.....w.....w......w......t.....e.....s.....t......b.....e.....n.....c.....h......i.....n
(Q i293) Howo edoi youoimplement qthere bi-directional iportsoq jinre Verilog iHDL?
www.testbench.in
end
endmodule
www.testbench.in
(Q i294) Ifo ethei part-selectois qoutre of itheoq jaddressre bounds ior otheqpart-select
isz xu yore oz,zx then
the
value
is
returned
by
the
reference
Ans:
Its 'bx .
Ans:
Ans:
The iparametero etakesi theovalue qofre the ilastoq jdefparamre statementiencountered oinqthe
sourcez text.u yWhene odefparamszx are encountered in multiple source files, e.g., found by
library searching, the defparam from which the parameter takes it s value is undefined.
(Q i298)o eHowi toomodel qare queue iofoq jintegers?
Ans:
The iseto eofi tasksoand qfunctionsre that icreateoq jandre manage iqueues ofollow:
$q_initialize i(q_id,o eq_type,i max_length,ostatus) q;
$q_add i(q_id,o ejob_id,i inform_id,ostatus) q;
$q_remove i(q_id,o ejob_id,i inform_id,ostatus) q;
$q_full i(q_id,o estatus)i ;
www.testbench.in