1

I want to communicate three modules, one is a control unit, second is an arithmetic unit, and the third is Ram-like memory.

I'm a beginner, I know that I can connect two modules by instantiate one inside the other. For example the ALU ports inside the Control Unit.

What I want to do now is to extract a data from the RAM and send it to the ALU, only if Control Unit ask it to do it.

So it seems I would have to instantiate the same module, some ports at the Control unit and some of the (the data) to the ALU.

// In the Control Unit part of the port of the same instantiation

RAM_U RAM_U_inst1 (
.read (read)
);


// In the ALU module the other part

RAM_U RAM_U_inst1 (
.data (data)
);

In this case when RAM_U receive the order to read, it will send the data to the ALU.

Is this the correct way to do this? FPGA Synthesizable

0

1 Answer 1

4

Please don't do this, either make instance of all module in single top module called module micro_controller(....).

What I want to do now is to extract a data from the RAM and send it to the ALU, only if Control Unit ask it to do it.

Control unit will give address to RAM, and fetch data from it, and then provide to ALU, now result produced by ALU or RAM write can also done with control unit.

enter image description here

Are you able to understand?

Sign up to request clarification or add additional context in comments.

5 Comments

So, having the top module as you said, I still don't understand how to communicate the modules. Should I use registers in the top module, or a FSM?
ok! I will tell you how to do it. When instruction comes like ADD A, 25H; // add A + content at mem location 25H When control unit decode this instruction it will come to know that, it has to fetch data from location 25H, so it drive its memory interface for reading 25H location when read data comes, it will fed to ALU with Operand as read value and instruct ALU to do addition, some part of OP-Code given to ALU for doing addition too. If you still not understand copy your three modules. I'll check possible connections.
Thanks you gave me good idea, although am not exactly doing a microcontroller.
Oh yeah! I know, but it is just concept of embed functional block and architecture development.
And yes, your control unit has to have FSM for controlling sequence of operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.