0
\$\begingroup\$

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

\$\endgroup\$
3
  • \$\begingroup\$ This should help for your first question: en.wikipedia.org/wiki/Arithmetic_shift \$\endgroup\$
    – deinoppa
    Jan 26, 2016 at 8:31
  • \$\begingroup\$ There are many different multiplier architectures, the basic concept is also explained on wikipedia: en.wikipedia.org/wiki/Binary_multiplier \$\endgroup\$
    – deinoppa
    Jan 26, 2016 at 8:38
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – Paebbels
    Jan 26, 2016 at 10:55

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ 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. \$\endgroup\$
    – Daniele
    Jan 26, 2016 at 13:53
  • \$\begingroup\$ 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. \$\endgroup\$
    – user16324
    Jan 26, 2016 at 14:55
  • \$\begingroup\$ 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 :) \$\endgroup\$
    – Daniele
    Jan 26, 2016 at 15:10
  • \$\begingroup\$ Well the question didn't prohibit a multi-cycle solution... \$\endgroup\$
    – user16324
    Jan 26, 2016 at 15:15

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.