Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Build a Register

Altera_Forum
Honored Contributor II
1,873 Views

Hello Guys :) 

I got a new question :p  

I have a 32 bit binary number, I want to put it in a register. 

1. Is this possible to build a 32 Bit register ? if yes how can i do this ? 

2. If no, how can I build 4 times 8Bit registers ? 

thx
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
1,172 Views

recal in yesterdays question about code and processes, you used the following, 

signal cntr_devider : std_logic_vector (23 downto 0); 

 

OK, so once you decalre the signal in the form std_logic_vector you have in fact said it is (in this case) a 24 bit value. 

 

So, for your desired 32 bit binary number you would declare it as (31downto 0). 

 

Note that direction of the vector does matter. (31 downto 0) is flipped from (0 to 31) 

 

With FPGA's it is possible to build a register of almost any size you want. 

 

Hope this helps, 

Avatar
0 Kudos
Altera_Forum
Honored Contributor II
1,172 Views

Thanks for your help  

One more question, i need to build a SPI (serial programming interface) for this 32 bit register, do u have any idea how to do this ? 

if yes i will be very happy to help me or to write me a code 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,172 Views

I do not, but you should be able to find this either somewhere else in here or in the NIOS Forum or in the MegaWizard IP secion of the tools.

0 Kudos
Altera_Forum
Honored Contributor II
1,172 Views
0 Kudos
Altera_Forum
Honored Contributor II
1,172 Views

Amirster, 

 

The questions you've been asking seem like many I've seen in homework assignments. It's great if you're trying to teach yourself about the technology, but if you're using this forum to do your homework, we're probably doing you a disservice.
0 Kudos
Altera_Forum
Honored Contributor II
1,172 Views

Hey :)  

I am not doing my homework :) 

I am just learning this code for me, and for my knowledge. 

I just finish my B.sc in computer science and I am studing VHDL for more knowledge.
0 Kudos
Reply