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.

Need Verilog code for instruction decoder of attiny 2313

Status
Not open for further replies.

cipi11

Newbie level 3
Joined
Jun 4, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Instruction decoder

I need a Verilog code for the instruction decoder of attiny 2313 (load and store instructions)

can anyone help me???
 

Instruction decoder

Could you please more detail about wat u need.
 

Re: Instruction decoder

Hi,

I think you what you want is the code for the Instruction Decoder of a CPU.. ie, the Control Block... This is'nt that easy but you can start by decoding a few simple instructions such as LOAD/STORE..

There are many types of load/store instructions...

LOADI data -> Load immediate the Acc with the data (Acc address is implicit)
LOAD A,B -> Load the Acc with the contents of Reg B
LOAD Reg, Data -> Load the specified register with immediate data.
etc...

First, you will have to come up with a flowchart of how each instruction is going to be executed...

for example... LOADI data

1. Check the opcode and determine what type of instruction it is.
2. If it is a Load immediate instruction, then get the immediate data from the
instruction.
If it is any other instruction... branch to that CASE statement and execute it.
3. Determine the address of the register.. in this case it is implicit, ie, Accumulator.
4. Write the data to the accumulator.
5. Increment PC (Program counter) to point to the next instruction.

It is important to increment PC so that it points to the next instruction in the queue.
When you write out the flowchart ... you will know how many clock cycles each instruction takes to execute.

This ID unit is one large CASE statement.. with several branches depending on the type of instruction being decoded and the actions taken.

This LOADI instruction will take 2 clocks ... one to fetch the data from the memory/instruction and the next to store it into the Acc.
 

Re: Instruction decoder

VLSI_whiz,
if you can notice there was a query of mine regarding this instruction decoder sort of code i have a question for .
with title if-elsif alternative.

can u please go through that post once and see whether it resembles this question .

Added after 1 minutes:

cipi 11 , even u can also go through the post .and let me know clearly what you are looking for.
 

Re: Instruction decoder

I need to describe in Verilog commands:
LDI – Load Immediate
LDS – Load Direct from Data Space
LD – Load Indirect from Data Space using Index X, Y, Z
STS – Store Direct to Data Space
ST – Store Indirect from Register to Data Space using X, Y, Z




If you have any example???
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top