Reply by Falk Brunner March 31, 20062006-03-31
preet schrieb:

> I have written the code for my encoder below. It is synthesizable and has no errors.
This is good, but does not prove too much.
> What i want to do is after programming the FPGA(Spartan3 starter kit), I want to check the results from the harware. > > Means using LEDs for 3 bit output and switch for the input.
This might be a nice test (or better call it play around), but a simulation is much better and does show much more. So your "test" isn't a real test, it has no practical relevance.
> My code also contains the clock signal. > > IF i lock one switch to Clock and then toggle it's not working and i think it won't.
You can't use a normal switch to supply a clock to a digital circuit, especially not a modern FPGA. The switch WILL bounce and produce multiple pulses. A debouncing is necessary, either by hardware (RC-filter + schmitt trigger) or software (logic inside the FPGA)
> I want to test this code on hardware. > > Some one suggested Using Picoblaze, RS232,UART connection. > > I really have no clue of how to do it.
Looks like you just starting to get into the digital/FPGA business. Start small. Get a simpler circuit thant a Viterby decoder. Get a feeling for simulation and testing in hardware, understand the difference and the idea behind the different ways of testing. For instance, build a simple 4 bit counter. Do a clean simulation. Implement it in hardware. Test it in hardware (use a switch debouncer). Then go on to the Viterby.
> Where to get picoblaze, how to program it to take input from RS232,
> where to get UART models. And how will i be writing the text in hyperterminal > to send the data through this port.Will i be actually toggling the > switch which i have locked for input. Picoblaze can be found on the Xilinx website, look for xapp213.
> I badly need help on this.
I think you need to understand some basic concepts first. Regards Falk
Reply by preet March 30, 20062006-03-30
Thanks so much to all who replied to my previous messages I appreciate your concern.

Please help me on this.

I have written the code for my encoder below. It is synthesizable and has no errors.

What i want to do is after programming the FPGA(Spartan3 starter kit), I want to check the results from the harware.

Means using LEDs for 3 bit output and switch for the input.

My code also contains the clock signal.

IF i lock one switch to Clock and then toggle it's not working and i think it won't.

I want to test this code on hardware.

Some one suggested Using Picoblaze, RS232,UART connection.

I really have no clue of how to do it.

Where to get picoblaze, how to program it to take input from RS232, where to get UART models. And how will i be writing the text in hyperterminal to send the data through this port.Will i be actually toggling the switch which i have locked for input.

I badly need help on this.

thanks and regards

Code:

module encoder(outp,clk,res,inp); input clk,res,inp; outp[2:0] outp; reg [4:0]ff;

always@(posedge clk) begin

if(res) ff[4:0]<=5'b0; else

begin ff[3:0]<=ff[4:1]; ff[4]<=inp; end

end

assign outp[0]=ff[4]^ff[2]^ff[0]; assign outp[1]=ff[4]^ff[3]^ff[1]^ff[0]; assign oupt[2]=ff[4]^ff[3]^ff[2]^ff[1]^ff[0]; endmodule