1、计算机科学与工程学院课程设计报告题目全称: 16位定点数原码一位乘法器的设计与实现 课程名称: 计算机组成原理 指导老师: 谭浩 职称: 序号学生姓名学号班号成绩1刘晓窗201206001000620120600102李育桥201206001002520120600103郭建准4李浩5李志飞678910(注:学生姓名填写按学生对该课程设计的贡献及工作量由高到底排列,分数按排名依次递减。序号排位为“1”的学生成绩最高,排位为“10”的学生成绩最低。)指导老师评语: 签字: 摘 要摘 要Verilog HDL 语言具有下述描述能力:设计的行为特性、设计的数据流特性、设计的结构组成以及包含响应监控和
2、设计验证方面的时延和波形产生机制。本实验用Verilog HDL语言设计了全加器实现的组合乘法器,通过功能仿真,验证了结果。关键词: 乘法器,Verilog,组合逻辑,全加器- III -AbstractABSTRACTText.Keywords:目 录目录(自动插入目录)第一章 绪论11.1 选题背景及意义11.2 国内外研究现状11.3 主要内容与章节安排11.4 本章小结1第二章 课程设计的需求分析32.1 环境需求32.2 功能需求32.3 性能需求32.3 本章小结3第三章 *的设计53.1 总体设计53.2 功能模块设计53.3 本章小结5第四章 *的实现74.1 开发环境介绍74
3、.2 主要功能模块的实现74.3 本章小结7第五章 测试及成果展示95.1 测试环境95.2 测试用例和结果95.3 成果展示95.4 本章小结9第六章 总结与展望11参考文献12第一章 绪论第一章 绪论1.1 选题背景及意义随着计算机科学技术的发展,人们获得信息的途径更加多样,获取信息的速度更加快捷。硬件的发展允许程序员编出很多精彩的使用软件,也使得计算机更加普及。中央处理器CPU的好坏是影响和制约计算机速度和性能的关键因素。而加法器是组成CPU的的重要部件,一般运算速度的快慢就取决与每秒执行加法的次数,加法器是算术逻辑单元中的基本逻辑器件。例如:为了节省资源,减法器和硬件乘法器都可由加法器
4、来构成。1.2 国内外研究现状1.3 主要内容与章节安排1.4 本章小结- 23 -第二章 课程设计的需求分析第二章 课程设计的需求分析2.1 环境需求PC、win7、ise7.1、xc3s100e-4vq100芯片、2.2 功能需求x、y为两个16位定点数,z为32位数,作为输出。实现16位定点数乘法。2.3 性能需求2.3 本章小结第三章 *的设计第三章16位乘法器的设计3.1 总体设计3.2 功能模块设计3.3 本章小结第四章 *的实现第四章 *的实现4.1 开发环境介绍4.2 主要功能模块的实现module multi16(x,y,clock,z);input15:0 x,y;/定义乘
5、数input clock; /定义时钟clockoutput31:0 z; /定义和的输出zreg 15:0 reg_x;/定义寄存器xreg 15:0 reg_y; /定义寄存器yreg 31:0 reg_z; /定义寄存器zwire16:0 p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15;/定义分别用来存储a十六位与b的每一位相与的结果wire75:0 j1,k1;wire50:0 j2,k2;wire32:0 j3,k3;wire22:0 j4,k4;wire15:0 j5,k5;wire6:0 j6,k6;wire2:0 j7
6、,k7;wire8:0 j8,k8;wire21:0 j9,k9;assign z=reg_z;/将寄存器z的内容赋给输出和zalways (posedge clock)/时序逻辑语句块begin reg_x =x ;/将加数x的值存到寄存器reg_x中 reg_y =y ; /将被加数y的值存到寄存器reg_y中 reg_z=j921,k921,k920,k919,k918,k917,k916,k915,k914,k913,k912,k911,k910,k99,k98,k97,k96,k95,k94,k93,k92,k91,k90,k80,k70,k60,k50,k40,k30,k20,k1
7、0,p00;/分别求得的和的每一位赋给reg_zend/对a的16位与b的每一位相与pp pp0(reg_x,reg_y0,p0);pp pp1(reg_x,reg_y1,p1);pp pp2(reg_x,reg_y2,p2);pp pp3(reg_x,reg_y3,p3);pp pp4(reg_x,reg_y4,p4);pp pp5(reg_x,reg_y5,p5);pp pp6(reg_x,reg_y6,p6);pp pp7(reg_x,reg_y7,p7);pp pp8(reg_x,reg_y8,p8);pp pp9(reg_x,reg_y9,p9);pp pp10(reg_x,reg_
8、y10,p10);pp pp11(reg_x,reg_y11,p11);pp pp12(reg_x,reg_y12,p12);pp pp13(reg_x,reg_y13,p13);pp pp14(reg_x,reg_y14,p14);pp pp15(reg_x,reg_y15,p15);/调用全加器与半加器,通过实例化求得和的每一位与每位的进位信号halfadder ha1(p01,p10,k10,j10);fulladder fa1(p02,p11,p20,k11,j11);fulladder fa2(p03,p12,p21,k12,j12);fulladder fa3(p04,p13,p2
9、2,k13,j13);fulladder fa4(p05,p14,p23,k14,j14);fulladder fa5(p06,p15,p24,k15,j15);fulladder fa6(p07,p16,p25,k16,j16);fulladder fa7(p08,p17,p26,k17,j17);fulladder fa8(p09,p18,p27,k18,j18);fulladder fa9(p010,p19,p28,k19,j19);fulladder fa10(p011,p110,p29,k110,j110);fulladder fa11(p012,p111,p210,k111,j11
10、1);fulladder fa12(p013,p112,p211,k112,j112);fulladder fa13(p014,p113,p212,k113,j113);fulladder fa14(p015,p114,p213,k114,j114);fulladder fa15(p115,p214,p313,k115,j115);fulladder fa16(p215,p314,p413,k116,j116);fulladder fa17(p315,p414,p513,k117,j117);fulladder fa18(p415,p514,p613,k118,j118);fulladder
11、fa19(p515,p614,p713,k119,j119);fulladder fa20(p615,p714,p813,k120,j120);fulladder fa21(p715,p814,p913,k121,j121);fulladder fa22(p815,p914,p1013,k122,j122);fulladder fa23(p915,p1014,p1113,k123,j123);fulladder fa24(p1015,p1114,p1213,k124,j124);fulladder fa25(p1115,p1214,p1313,k125,j125);fulladder fa26
12、(p1215,p1314,p1413,k126,j126);fulladder fa27(p1315,p1414,p1513,k127,j127);fulladder fa28(p32,p41,p50,k128,j128);fulladder fa29(p33,p42,p51,k129,j129);fulladder fa30(p34,p43,p52,k130,j130);fulladder fa31(p35,p44,p53,k131,j131);fulladder fa32(p36,p45,p54,k132,j132);fulladder fa33(p37,p46,p55,k133,j133
13、);fulladder fa34(p38,p47,p56,k134,j134);fulladder fa35(p39,p48,p57,k135,j135);fulladder fa36(p310,p49,p58,k136,j136);fulladder fa37(p311,p410,p59,k137,j137);fulladder fa38(p312,p411,p510,k138,j138);fulladder fa39(p412,p511,p610,k139,j139);fulladder fa40(p512,p611,p710,k140,j140);fulladder fa41(p612,
14、p711,p810,k141,j141);fulladder fa42(p712,p811,p910,k142,j142);fulladder fa43(p812,p911,p1010,k143,j143);fulladder fa44(p912,p1011,p1110,k144,j144);fulladder fa45(p1012,p1111,p1210,k145,j145);fulladder fa46(p1112,p1211,p1310,k146,j146);fulladder fa47(p1212,p1311,p1410,k147,j147);fulladder fa48(p1312,
15、p1411,p1510,k148,j148);fulladder fa49(p62,p71,p80,k149,j149);fulladder fa50(p63,p72,p81,k150,j150);fulladder fa51(p64,p73,p82,k151,j151);fulladder fa52(p65,p74,p83,k152,j152);fulladder fa53(p66,p75,p84,k153,j153);fulladder fa54(p67,p76,p85,k154,j154);fulladder fa55(p68,p77,p86,k155,j155);fulladder f
16、a56(p69,p78,p87,k156,j156);fulladder fa57(p79,p88,p97,k157,j157);fulladder fa58(p89,p98,p107,k158,j158);fulladder fa59(p99,p108,p117,k159,j159);fulladder fa60(p109,p118,p127,k160,j160);fulladder fa61(p119,p128,p137,k161,j161);fulladder fa62(p129,p138,p147,k162,j162);fulladder fa63(p139,p148,p157,k16
17、3,j163);fulladder fa64(p92,p101,p110,k164,j164);fulladder fa65(p93,p102,p111,k165,j165);fulladder fa66(p94,p103,p112,k166,j166);fulladder fa67(p95,p104,p113,k167,j167);fulladder fa68(p96,p105,p114,k168,j168);fulladder fa69(p106,p115,p124,k169,j169);fulladder fa70(p116,p125,p134,k170,j170);fulladder
18、fa71(p126,p135,p144,k171,j171);fulladder fa72(p136,p145,p154,k172,j172);fulladder fa73(p122,p131,p140,k173,j173);fulladder fa74(p123,p132,p141,k174,j174);fulladder fa75(p133,p142,p151,k175,j175);halfadder ha2(k11,j10,k20,j20); fulladder fa76(k12,p30,j11,k21,j21);fulladder fa77(k13,p31,p40,k22,j22);f
19、ulladder fa78(k14,k128,j13,k23,j23);fulladder fa79(k15,k129,p60,k24,j24);fulladder fa80(k16,k130,p61,k25,j25);fulladder fa81(k17,k131,k149,k26,j26);fulladder fa82(k18,k132,k150,k27,j27);fulladder fa83(k19,k133,k151,k28,j28);fulladder fa84(k110,k134,k152,k29,j29);fulladder fa85(k111,k135,k153,k210,j2
20、10);fulladder fa86(k112,k136,k154,k211,j211);fulladder fa87(k113,k137,k155,k212,j212);fulladder fa88(k114,k138,k156,k213,j213);fulladder fa89(k115,k139,k157,k214,j214);fulladder fa90(k116,k140,k158,k215,j215);fulladder fa91(k117,k141,k159,k216,j216);fulladder fa92(k118,k142,k160,k217,j217);fulladder
21、 fa93(k119,k143,k161,k218,j218);fulladder fa94(k120,k144,k162,k219,j219);fulladder fa95(k121,k145,k163,k220,j220);fulladder fa96(k122,k146,p149,k221,j221);fulladder fa97(k123,k147,p159,k222,j222);fulladder fa98(k124,k148,j123,k223,j223);fulladder fa99(k125,p1412,p1511,k224,j224);fulladder fa100(k126
22、,p1512,j125,k225,j225);fulladder fa101(p1415,p1514,j127,k226,j226);fulladder fa102(p70,j15,j129,k227,j227);fulladder fa103(p90,j17,j131,k228,j228);fulladder fa104(p91,p100,j18,k229,j229);fulladder fa105(k164,j19,j133,k230,j230);fulladder fa106(k165,p120,j110,k231,j231);fulladder fa107(k166,p121,p130
23、,k232,j232);fulladder fa108(k167,k173,j112,k233,j233);fulladder fa109(k168,k174,p150,k234,j234);fulladder fa110(k169,k175,j114,k235,j235);fulladder fa111(k170,p143,p152,k236,j236);fulladder fa112(k171,p153,j116,k237,j237);fulladder fa113(k172,j117,j141,k238,j238);fulladder fa114(p146,p155,j118,k239,
24、j239);fulladder fa115(p156,j119,j143,k240,j240);fulladder fa116(j120,j144,j162,k241,j241);fulladder fa117(p158,j121,j145,k242,j242);fulladder fa118(j134,j152,j164,k243,j243);fulladder fa119(j111,j135,j153,k244,j244);fulladder fa120(j136,j154,j166,k245,j245);fulladder fa121(j113,j137,j155,k246,j246);
25、fulladder fa122(j138,j156,j168,k247,j247);fulladder fa123(j115,j139,j157,k248,j248);fulladder fa124(j140,j158,j170,k249,j249);fulladder fa125(j142,j160,j172,k250,j250);halfadder ha3(j20,k21,k30,j30); fulladder fa126(k22,j21,j12,k31,j31);fulladder fa127(k24,j23,j14,k32,j32);fulladder fa128(k25,j24,k2
26、27,k33,j33);fulladder fa129(k26,j25,j227,k34,j34);fulladder fa130(k27,j26,k228,k35,j35);fulladder fa131(k28,j27,k229,k36,j36);fulladder fa132(k29,j28,k230,k37,j37);fulladder fa133(k210,j29,k231,k38,j38);fulladder fa134(k211,j210,k232,k39,j39);fulladder fa135(k212,j211,k233,k310,j310);fulladder fa136
27、(k213,j212,k234,k311,j311);fulladder fa137(k214,j213,k235,k312,j312);fulladder fa138(k215,j214,k236,k313,j313);fulladder fa139(k216,j215,k237,k314,j314);fulladder fa140(k217,j216,k238,k315,j315);fulladder fa141(k218,j217,k239,k316,j316);fulladder fa142(k219,j218,k240,k317,j317);fulladder fa143(k220,
28、j219,k241,k318,j318);fulladder fa144(k221,j220,k242,k319,j319);fulladder fa145(k222,j221,j242,k320,j320);fulladder fa146(k223,j222,j147,k321,j321);fulladder fa147(k224,j223,j124,k322,j322);fulladder fa148(j225,k127,j126,k323,j323);fulladder fa149(j228,j132,j150,k324,j324);fulladder fa150(j231,k244,j
29、243,k325,j325);fulladder fa151(j232,k245,j244,k326,j326);fulladder fa152(j233,k246,j245,k327,j327);fulladder fa153(j234,k247,j246,k328,j328);fulladder fa154(j235,k248,j247,k329,j329);fulladder fa155(j236,k249,j248,k330,j330);fulladder fa156(j237,j249,j159,k331,j331);fulladder fa157(j239,j250,j161,k3
30、32,j332);halfadder ha4(k31,j30,k40,j40); fulladder fa158(k23,j22,j31,k41,j41);fulladder fa159(k34,j33,j16,k42,j42);fulladder fa160(k35,j34,j149,k43,j43);fulladder fa161(k36,k324,j35,k44,j44);fulladder fa162(k37,j36,j324,k45,j45);fulladder fa163(k38,j37,j230,k46,j46);fulladder fa164(k39,j38,k325,k47,
31、j47);fulladder fa165(k310,j39,k326,k48,j48);fulladder fa166(k311,j310,k327,k49,j49);fulladder fa167(k312,j311,k328,k410,j410);fulladder fa168(k313,j312,k329,k411,j411);fulladder fa169(k314,j313,k330,k412,j412);fulladder fa170(k315,j314,k331,k413,j413);fulladder fa171(k316,j315,j331,k414,j414);fullad
32、der fa172(k317,j316,k332,k415,j415);fulladder fa173(k318,j317,j332,k416,j416);fulladder fa174(k319,j318,j241,k417,j417);fulladder fa175(k320,j319,j122,k418,j418);fulladder fa176(k322,j321,j148,k419,j419);fulladder fa177(j322,k225,j224,k420,j420);fulladder fa178(j326,j167,j173,k421,j421);fulladder fa
33、179(j328,j169,j175,k422,j422);halfadder ha5(k41,j40,k50,j50);fulladder fa180(k32,j128,j41,k51,j51);fulladder fa181(k45,j44,j229,k52,j52);fulladder fa182(k46,j45,k243,k53,j53);fulladder fa183(k47,j46,j165,k54,j54);fulladder fa184(k48,j47,j325,k55,j55);fulladder fa185(k49,j48,k421,k56,j56);fulladder f
34、a186(k410,j49,j421,k57,j57);fulladder fa187(k411,j410,k422,k58,j58);fulladder fa188(k412,j411,j422,k59,j59);fulladder fa189(k413,j412,j330,k510,j510);fulladder fa190(k414,j413,j238,k511,j511);fulladder fa191(k416,j415,j240,k512,j512);fulladder fa192(k417,j416,j163,k513,j513);fulladder fa193(k418,j41
35、7,j146,k514,j514);fulladder fa194(k321,j320,j418,k515,j515);halfadder ha6(j50,k51,k60,j60);fulladder fa195(j51,k33,j32,k61,j61);fulladder fa196(k57,j56,j327,k62,j62);fulladder fa197(k59,j58,j329,k63,j63);fulladder fa198(k510,j59,j171,k64,j64);fulladder fa199(k511,j510,k250,k65,j65);fulladder fa200(k
36、415,j414,j511,k66,j66);halfadder ha7(k61,j60,k70,j70);fulladder fa201(j61,k42,j130,k71,j71);fulladder fa202(k58,j57,j62,k72,j72);halfadder ha8(k71,j70,k80,j80);halfadder ha9(k43,j42,k81,j81);halfadder ha10(k44,j43,k82,j82);halfadder ha11(k52,j151,k83,j83);halfadder ha12(k53,j52,k84,j84);halfadder ha
37、13(k54,j53,k85,j85);halfadder ha14(k55,j54,k86,j86);halfadder ha15(k56,j55,k87,j87);halfadder ha16(k62,j174,k88,j88);fulladder fa203(k81,j80,j71,k90,j90);fulladder fa204(k82,j81,j90,k91,j91);fulladder fa205(k83,j82,j91,k92,j92);fulladder fa206(k84,j83,j92,k93,j93);fulladder fa207(k85,j84,j93,k94,j94);
©2010-2024 宁波自信网络信息技术有限公司 版权所有
客服电话:4008-655-100 投诉/维权电话:4009-655-100