# Some question about RTL Design and VHDL

I have some question almost uncorrelated, so I'll enureamted it, hope you can help me:

1) I'm studing RTL Design, and the question is at level of data path, arithmetic unit ecc. I don't understand why and how a shifter can be used to do the multiplication and division operation. For example, if someone ask me "how many adder (or shifter) is needed to do a multiplication between to operand composed by X bit", what is the method that I have to apply to answer this question? Another question. In a book I've read that the operation A+B=K, in wich the output is 1 if the sum of A and B is egual to K, 0 otherwise, can be performed evaluting the Carry expected and Carry obtained by summation. I didn't understand this concept, can you please explain me?

2) VHDL. This question is simple, I think. In all example in the books, when a flip-flop is present, the rising edge of the clock is managed in this way: process(clk), and then for expalin the rising edge there is a line "if(clk'event & clk = 1)". The question si: why "clk'event" is necessary? The signal clk is inside the process, so we go inside the process each time the clock change its state, isn't sufficient to evalute only if clock is egual to 1, because the clk'event is Always true?

Thank you

• This should help for your first question: en.wikipedia.org/wiki/Arithmetic_shift Jan 26, 2016 at 8:31
• There are many different multiplier architectures, the basic concept is also explained on wikipedia: en.wikipedia.org/wiki/Binary_multiplier Jan 26, 2016 at 8:38
• For part 2: Sensitivity lists are ignored by synthesis tools, so if your HDL code should also be useful for synthesis, then you should apply this pattern or use if rising_edge(clk) then. Another reason is flexability. You don't need to rewrite your code if you extend the register description with an asynchronous reset. Jan 26, 2016 at 10:55

For part (2) - if the sensitivity list of a process contains other signals, and there is activity on those signals while clk = '1' then the process will operate multiple times per clock cycle. If it's a counter, that would be bad...

Worse, synthesis would ignore the extra events (because there is no hardware feature to implement them) so simulation and synth would behave differently.

Incidentally, if(clk'event & clk = 1) has been obsolete for over 20 years; so your teaching materials are sorely out of date. As @Paebbels says, use if rising_edge(clk) instead.

Part (1) is neither a VHDL nor an RTL question but basic arithmetic : searching "multiplication by shift and add" should net more information than you will ever want.

• I'm using "top down digital VLSI design" by Kaeslin. It seems a good book, and for sure isn't old (some example, real technology table ecc use very recent products e.g. Core 2 duo by Intel, or for example 28 nm technology). For the part (1), maybe isn't a RTL question, but I don't figure out how the algorithm can be translated in RTL. I wrote the example, when I have the product of two number A, of m bit , and B, of n bit, and I want to fin how many adders and shifters I need to do this product. Jan 26, 2016 at 13:53
• I'll give you a hint : you can do it with one of each, a register, and a very simple state machine, if you are allowed min(m,n) clock cycles.
– user16324
Jan 26, 2016 at 14:55
• you are using a iterative decomposition...so the question that I have done can be rearranged in "how many clock cycle...". However isn't so different, I understand the hint :) Jan 26, 2016 at 15:10
• Well the question didn't prohibit a multi-cycle solution...
– user16324
Jan 26, 2016 at 15:15