In this work I show how to build a reference model
in systemc using queues, 
from C++ STD. 
- 
Link to the main page of this 
work.
This page explains the DUT used in this project.
 
- 
The DUT is a complex multiplier. For a given two complex numbers, their complex 
multiplication is calculated. All numbers are represented 
as two-dimensional Cartesian coordinate.
(a+jb) x (c+jd) = (ac - bd) +j(ad + bc)
The algorithm used to calculate the complex multiplication is as follows:
P=c x (a-c), Q=a x (c+d), R=b x (c-d)
(P+R) + j(Q-P)
 
- 
But instead of using four multipliers only three are used.
Multipliers consume more resources then adders and subtracters, so this 
design may be smaller in area than a regular one (using four multipliers).
 
- 
The inputs are 8 bits and the output is 14 bits. 
Sign extension is performed 
on the input, before calculating the output.
The combinatorial code is shown below:
...
-   void summ_p() {
 
-     sum_p.write((a.read().range(7,7), a.read()) - (b.read().range(7,7), b.read()));
 
-     sum_q.write((c.read().range(7,7), c.read()) + (d.read().range(7,7), d.read()));
 
-     sum_r.write((c.read().range(7,7), c.read()) - (d.read().range(7,7), d.read()));
 
-   }
 
-   void mull_p() {
 
-     mul_p.write(cq.read() * sum_pq.read());
 
-     mul_q.write(aq.read() * sum_qq.read());
 
-     mul_r.write(bq.read() * sum_rq.read());
 
-   }
 
-   void out_p() {
 
-     s_oa.write(mul_pq.read() + mul_rq.read());
 
-     s_ob.write(mul_qq.read() - mul_pq.read());
 
-   }
 
...
 
 
 
                           |