1  Serial-parallel multiplier

  Figure 12.1 shows the RTL diagram of a serial-parallel multiplier. One of the input vectors (a) is applied serially to the circuit (one bit at a time, starting from the LSB), while the other (b) is applied in parallel (all bits simultaneously). Say that a has M bits, while b has N. Then, after all M bits of a have been presented to the system, a string of M ‘0’s must follow, in order to complete the (M þ N)-bit output product.

  

  This system is pipelined, and is constructed using AND gates, full-adder units, plus registers (flip-flops). Each unit of the pipeline (except the leftmost one) requires one adder and two registers, plus an AND gate to compute one of the inputs. Thus for an M x N multiplier, O(N) of such units are required.

2  VHDL

  1) and_2.vhd

 library IEEE;
use ieee.std_logic_1164.all; entity and_2 is
port
(
a, b: in std_logic;
y: out std_logic
);
end and_2; architecture sim of and_2 is
begin
y <= a and b; end sim;

  2) reg.vhd

 library IEEE;
use ieee.std_logic_1164.all; entity reg is
port
(
d, clk, rst: in std_logic;
q: out std_logic
);
end reg; architecture sim of reg is
begin
process(clk, rst)
begin
if (rst = '') then q <= '';
elsif (clk'event and clk = '') then q <= d;
end if;
end process; end sim;

  3) fau.vhd

 library IEEE;
use ieee.std_logic_1164.all; entity fau is
port
(
a, b, cin: in std_logic;
s, cout: out std_logic
);
end fau; architecture sim of fau is
begin
s <= a xor b xor cin;
cout <= (a and b) or (a and cin) or (b and cin); end sim;

  4)  pipe

 library IEEE;
use ieee.std_logic_1164.all; library work;
use work.my_components.all; entity pipe is
port
(
a, b, clk, rst: in std_logic;
q: out std_logic
);
end pipe; architecture sim of pipe is
signal s, cin, cout: std_logic;
begin
U1: component fau port map(a, b, cin, s, cout);
U2: component reg port map(cout, clk, rst, cin);
U3: component reg port map(s, clk, rst, q);
end sim;

  5) my_components.vhd

 library IEEE;
use ieee.std_logic_1164.all; package my_components is component and_2 is
port
(
a, b: in std_logic;
y: out std_logic
);
end component; component fau is
port
(
a, b, cin: in std_logic;
s, cout: out std_logic
);
end component; component reg is
port
(
d, clk, rst: in std_logic;
q: out std_logic
);
end component; component pipe is
port
(
a, b, clk, rst: in std_logic;
q: out std_logic
);
end component; end my_components;

  6) multiplier.vhd

 library IEEE;
use ieee.std_logic_1164.all; library work;
use work.my_components.all; entity multiplier is
port
(
a, clk, rst: in std_logic;
b: in std_logic_vector( downto );
prod: out std_logic
);
end multiplier; architecture sim of multiplier is
signal and_out, reg_out: std_logic_vector( downto );
begin
U1: component and_2 port map(a, b(), and_out());
U2: component and_2 port map(a, b(), and_out());
U3: component and_2 port map(a, b(), and_out());
U4: component and_2 port map(a, b(), and_out());
U5: component reg port map(and_out(), clk, rst, reg_out());
U6: component pipe port map(and_out(), reg_out(), clk, rst, reg_out());
U7: component pipe port map(and_out(), reg_out(), clk, rst, reg_out());
U8: component pipe port map(and_out(), reg_out(), clk, rst, reg_out()); prod <= reg_out(); end sim;

VHDL之Serial-Parallel Multiplier的更多相关文章

  1. Serial,Parallel,CMS,G1四大GC收集器特点小结

    1.Serial收集器一个单线程的收集器,在进行垃圾收集时候,必须暂停其他所有的工作线程直到它收集结束.特点:CPU利用率最高,停顿时间即用户等待时间比较长.适用场景:小型应用通过JVM参数-XX:+ ...

  2. 转Serial,Parallel,CMS,G1四大GC收集器特点小结

    转 https://blog.csdn.net/u013812939/article/details/48782343 1.Serial收集器 一个单线程的收集器,在进行垃圾收集时候,必须暂停其他所有 ...

  3. The The Garbage-First (G1) collector since Oracle JDK 7 update 4 and later releases

    Refer to http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html for detail. 一些内容复制到这儿 Th ...

  4. [转]Windows进程间通信的各种方法

    http://www.cnblogs.com/songQQ/archive/2009/06/03/1495764.html 道相似,不过它传输数据是通过不可靠的数据报(如TCP/IP协议中的UDP包) ...

  5. C#的变迁史 - C# 4.0 之并行处理篇

    前面看完了Task对象,这里再看一下另一个息息相关的对象Parallel. Parallel对象 Parallel对象封装了能够利用多核并行执行的多线程操作,其内部使用Task来分装多线程的任务并试图 ...

  6. 对Java垃圾回收最大的误解是什么

    当 我还是小孩的时候,父母常说如果你不好好学习,就只能去扫大街了.但他们不知道的是,清理垃圾实际上是很棒的一件事.可能这也是即使在Java的世界中, 同样有很多开发者对GC算法产生误解的原因--包括它 ...

  7. devices-list

    转自:https://www.kernel.org/pub/linux/docs/lanana/device-list/devices-2.6.txt LINUX ALLOCATED DEVICES ...

  8. Java Garbage Collection/垃圾收集 策略查看

    Java 的垃圾收集有各种各样的策略,默认的策略也会经常的改变. --比如到底是 serial , parallel, CMS; 具体到 Minor 怎么样,Old 又怎么样? 命令 java -XX ...

  9. [翻译]Java垃圾收集精粹(Java Garbage Collection Distilled)

    source URL: http://www.infoq.com/articles/Java_Garbage_Collection_Distilled Name: Java Garbage Colle ...

  10. JVM系列二:GC策略&内存申请、对象衰老

    JVM里的GC(Garbage Collection)的算法有很多种,如标记清除收集器,压缩收集器,分代收集器等等,详见HotSpot VM GC 的种类 现在比较常用的是分代收集(generatio ...

随机推荐

  1. 20180906关于mysql启动

    转自 https://blog.csdn.net/sqlserverdiscovery/article/details/52808541

  2. -- > define的用法与学习(1)

    在不久之前,我一直不理解为神马大家在做题时经常用define来代替某些函数,或者用来直接定义某些极大的变量.It is not until today that I understand why it ...

  3. 错误代码: 1045 Access denied for user &#39;skyusers&#39;@&#39;%&#39; (using password: YES)

    1. 错误描写叙述 GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "."; 1 queries e ...

  4. bzoj1106

    模拟+树状数组 先开始以为是先删距离最小的,这样可以减小上下的距离,然后觉得很难写,看码长很短,就看了题解,结果很奥妙 我们只考虑两种元素,就是如果像-a-b-a-b-这样的肯定得交换,如果像-a-b ...

  5. uoj#34

    模板 #include<bits/stdc++.h> #define pi acos(-1) using namespace std; ; int n, m, L, x; int r[N] ...

  6. Sort List 典型链表

    https://leetcode.com/problems/sort-list/ Sort a linked list in O(n log n) time using constant space ...

  7. thinkphp结合云之讯做短信验证码

    thinkphp结合云之讯做短信验证码先去云之讯注册账号 网址http://www.ucpaas.com/ 注册云之讯平台账号,即可免费获得10元测试费用测试够用啦 解压附件到 ThinkPHP\Li ...

  8. 互斥的数(hash)

    1553 互斥的数  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold     题目描述 Description 有这样的一个集合,集合中的元素个数由给定的N决定, ...

  9. 数值分析常见算法C++实现

    1.1-有效数字丢失现象观察 #include<bits./stdc++.h> using namespace std; double f1(double x) { )-sqrt(x)); ...

  10. 简单理解jsonp原理

    对于javascript程序员来说,发送ajax请求获取后台数据然后把数据和模板拼接成字符串渲染回DOM实现无刷新更新页面这样的操作可谓是轻车熟路.但众所周知,ajax有一个不好,就是不能跨域传输数据 ...