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. Hive之单独部署机器

    环境说明 CentOS7,hadoop-2.6.5,hive-1.2.2,MariaDB-5.5.60,jdk-1.8 假设hive机已经安装好了MariaDB(已启动且已创建好hive账号,对hiv ...

  2. 《Linux内核分析》MOOC课程

    http://www.cnblogs.com/wickedpriest/p/4315189.html

  3. Android GIS开发系列-- 入门季(4) GraphicsLayer的点击查询要素

    上一讲中我们学会了如何在MapView中添加Graphic要素,那么在百度或高德地图中,当我们点击要素时,会显示出相应的详细信息.在GraphicsLayer中也提供了这样的方法.下面我们来学习在Gr ...

  4. C++模板的特化与偏特化

    http://cppblog.com/SmartPtr/archive/2007/07/04/27496.html (1) 类模板定义一个栈的类模板,它可以用来容纳不同的数据类型 template & ...

  5. Android 应用按返回键异常退出的问题

    开发过程中遇到按返回键异常退出的问题,log显示为空指针异常,进一步产看是由于onActivityResult得到的Intent为空. 按返回键复写代码例如以下: @Override public v ...

  6. CentOS-6.4-DVD系统中安装Oracle-11.2.0.4

    完整版见https://jadyer.github.io/2014/05/18/centos-install-oracle/ /** * CentOS-6.4-DVD系统中安装Oracle-11.2. ...

  7. CoffeeScript里的or

    CoffeeScript里的or,其实会被编译为 || 这并没有什么令人惊奇之处.我惊讶的是类似这样一个表达式: word = null hi = word or "Hello World! ...

  8. 【转】Android的WebView控件载入网页显示速度慢的究极解决方案

    秒(甚至更多)时间才会显示出来.研究了很久,搜遍了国外很多网站,也看过PhoneGap的代码,一直无解. 一般人堆WebView的加速,都是建议先用webView.getSettings().setB ...

  9. ubuntu安装phpstorm

    首先要安装jdk $ java -version java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1 ...

  10. ubuntu安装ruby,安装sass,安装compass

    安装ruby apt-get install ruby. 默认会安装1.9的. 不是自己想要的. 可以进行下面的处理. # sudo apt-get install python-software-p ...