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
名誉分销商 II
2,147 次查看

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 项奖励
6 回复数
Altera_Forum
名誉分销商 II
1,446 次查看

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 项奖励
Altera_Forum
名誉分销商 II
1,446 次查看

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 项奖励
Altera_Forum
名誉分销商 II
1,446 次查看

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 项奖励
Altera_Forum
名誉分销商 II
1,446 次查看
0 项奖励
Altera_Forum
名誉分销商 II
1,446 次查看

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 项奖励
Altera_Forum
名誉分销商 II
1,446 次查看

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 项奖励
回复