Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Systemverilog interview question

Status
Not open for further replies.

Basu_Gouda

Member level 1
Joined
Nov 15, 2010
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Bangalore
Activity points
1,520
Taking clock as the reference how do you break 32 bit data into four 8 bit data using systemverilog
 

You yourself answered ,,,,using clock
but in which situation you are ,,we must have to know to suggest? :)
 

I suspect they are looking for you to create a state machine that takes a 32b sample every 4 cycles, and outputs 1 8b segment per cycle.
this can be done using a mux and a counter. there are several ways to write a mux and counter.

VHDL allows signals/variables to be used in slicing, eg x(8*(sel+1)-1 downto 8*sel) is valid and efficient in VHDL. Verilog doesn't allow this -- it doesn't allow regs/wires to be used for slicing. Verilog would need an intermediate [7:0] wire [3:0] to be declared, and a generate statement to assign the elements -- Verilog does allow constants, params, and genvar's to be used in slicing. Verilog also has a nice [offset+:width] operator, which can be used instead of the standard [width+offset-1:eek:ffset]. I'm not sure if system verilog changes the behavior of [:] to allow regs/logics/wires to be used.

likewise, for 4 elements you can write out each element. The code isn't as reusable and you likely won't impress the interviewer with your knowledge of the language. At the same time its easier to get correct and you will at least seem competent enough to write basic HDL.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top