虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

4位布斯乘<b>法器</b>模块及测试模块

  • 经统计

    经统计,某机器14条指令的使用频度分别为:0.01,0.15,0.12,0.03,0.02,0.04,0.02,0.04,0.01,0.13,0.15,0.14,0.11,0.03。分别求出用等长码、Huffman码、只有两种码长的扩展操作码3种编码方式的操作码平均码长。 解: 等长操作码的平均码长=4位 Huffman编码的平均码长=3.38位 只有两种码长的扩展操作码的平均码长=3.4位。 9.若某机要求:三地址指令4条,单地址指令255条,零地址指令16条。设指令字长为12位.每个 地址码长为3位。问能否以扩展操作码为其编码?如果其中单地址指令为254条呢?说明其理由。 答:①不能用扩展码为其编码。 ∵指令字长12位,每个地址码占3位; ∴三地址指令最多是2^(12-3-3-3)=8条, 现三地址指令需4条, ∴可有4条编码作为扩展码, ∴单地址指令最多为4×2^3×2^3=2^8=256条, 现要求单地址指令255条,∴可有一条编码作扩展码 ∴零地址指令最多为1×2^3=8条 不满足题目要求 ∴不可能以扩展码为其编码。 ②若单地址指令254条,可以用扩展码为其编码。 ∵依据①中推导,单地址指令中可用2条编码作为扩展码 ∴零地址指令为2×2^3=16条,满足题目要求

    标签:

    上传时间: 2015-04-30

    上传用户:zhangyigenius

  • LCD1602B基本驱动函数库 1、需要底层硬件驱动函数支持 基本的宏定义: LCD_RS LCD_RW LCD_E LCD_SetWriteData LCD_SetReadData

    LCD1602B基本驱动函数库 1、需要底层硬件驱动函数支持 基本的宏定义: LCD_RS LCD_RW LCD_E LCD_SetWriteData LCD_SetReadData LCD_HalfData_Port LCD_HalfData_DDR LCD_SendHalfCharHigh(a) LCD_SendHalfCharLow(a) 2、需要基本的延时函数支持基本的延时函数: DelayMs() 毫秒 DelayUs() 微妙 3、需要修改引用宏定义来指定底层硬件驱动 函数库。 4、该头文件支持4位发送模式,硬件连接4位 8位都支持。

    标签: LCD_SetWriteData LCD_SetReadData LCD_RS LCD_RW

    上传时间: 2015-05-20

    上传用户:wangchong

  • 数字运算

    数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no

    标签: 数字 运算

    上传时间: 2015-05-21

    上传用户:daguda

  • 在通讯中

    在通讯中,为了保证行运安全可靠,标准的串行口必须具有许多握手信号和 状态信息。这是因为通兜母鞲黾扑慊鶦PU速度不一样(这会导致“错帧”)以 及发送机发送数据速度比接收机接收速度快(这会导致“过冲”)。为解决这个 问题,我们采用一个简单的握手信号,即发送机每次仅发送半个字节(低4位) 的数据,而另外半个字节(高4位)则用来传送信息。我们可以对信息位(高4位) 进行如下简单的编码: 0H:发送的是新的半个字节数据 1H:重新发送上次传送错误的数据 2H:文件名结束 3H:文件结束 这样,每当发送机发送一个字节以后,就等待接受机发回送信号,这回送信号就 是发送机发送过来的那个字节。发送机接收到回送信号后,把它与刚发送的字节 相比较,如果相同,就发送新的半个字节,否则就重新发送。新数据与旧数据通 过信息位来区分。下面就是用C语言编写控制串行口的程序。

    标签: 通讯

    上传时间: 2015-05-22

    上传用户:黑漆漆

  • 这是s52的扫描显示程序

    这是s52的扫描显示程序,4个数码管,可显示4位不同的数字,通过按键改变数字的大小,适于51单片机初学者学习

    标签: s52 显示程序

    上传时间: 2015-05-25

    上传用户:wang5829

  • 源代码用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a

    源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).

    标签: lt 源代码 动态规划 序列

    上传时间: 2013-12-26

    上传用户:siguazgb

  • The government of a small but important country has decided that the alphabet needs to be streamline

    The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition

    标签: government streamline important alphabet

    上传时间: 2015-06-09

    上传用户:weixiao99

  • 电力系统在台稳定计算式电力系统不正常运行方式的一种计算。它的任务是已知电力系统某一正常运行状态和受到某种扰动

    电力系统在台稳定计算式电力系统不正常运行方式的一种计算。它的任务是已知电力系统某一正常运行状态和受到某种扰动,计算电力系统所有发电机能否同步运行 1运行说明: 请输入初始功率S0,形如a+bi 请输入无限大系统母线电压V0 请输入系统等值电抗矩阵B 矩阵B有以下元素组成的行矩阵 1正常运行时的系统直轴等值电抗Xd 2故障运行时的系统直轴等值电抗X d 3故障切除后的系统直轴等值电抗 请输入惯性时间常数Tj 请输入时段数N 请输入哪个时段发生故障Ni 请输入每时段间隔的时间dt

    标签: 电力系统 计算 运行

    上传时间: 2015-06-13

    上传用户:it男一枚

  • 8位和16位CRC检验接口程序

    8位和16位CRC检验接口程序,在CCS6000下测试通过。

    标签: CRC 8位 接口程序

    上传时间: 2014-01-04

    上传用户:fnhhs

  • 4个版本的java网上书城源码

    4个版本的java网上书城源码,功能模块多

    标签: java 版本 源码

    上传时间: 2014-01-11

    上传用户:onewq