CEG2136/CEG2536 Computer Architecture I Architecture des ordinateurs I MIDTERM EXAMINATION

Java Python CEG2136/CEG2536   Computer Architecture I

Architecture des ordinateurs I

MIDTERM

EXAMINATION

Instructions:

.   Answer ALL questions on the questionnaire.

.   This is a close-book examination.

.   Use the provided space to answer the following questions. For your calculations you can use pages 6-8.

.   Calculators are not allowed.

.   Read all the questions before you start.

Q1.      The range of signed integers N expressed in 2-s complement representation that can be

stored in a 10-bit register is:

(a) -1024≤N≤+1023     (b) -1023≤N≤+1024          (c) -512≤N≤+511           (d) -511≤N≤+512

(e) None of the above

Q2.      Identify the decimal number which is represented next in floating point with the IEEE

754 standard:               11000010100010101100000000000000

(a) (- 133.375)10    (b) (- 69.375)10       (c) (- 138.750)10     (d) (- 34.6875)10    (e) (- 8.671875)10

Q3)     Give the best binary approximation of A = (26.6)10  and B = - (23.4)10  employing signed

2’s-complement representation with 2 bits for the fractional part. A =                                                     B =

Q4)       1) Convert to decimal the following two numbers, 01010 & 10101, which are already

expressed in 2’s complement representation.

2) These numbers are stored in two 6-bit registers X and Y to calculate their sum

(S = X+Y) and their difference (D=X-Y) by using additions and 2’s complementation only. Convert to decimal and write each intermediate and final result, to check the correctness of

your assertions.

S = X+Y          2’s complement                   Base 10         D=X-Y             2’s complement                           Base 10

CY: X + Y

S

 

CY:  X + -Y    D

 

3) Since both S and D have to be represented with 6 bits, indicate if overflow occurs, and explain how a circuit can detect these situations.

Q5.      Which of the logic functions is implemented by the following circuit?

A'      B'     

f

    D     

(a) f(A,B,C,D) = Σm(4,5,6,7,8,9,10)+X(12,13,14,15) (b) f(A,B,C,D) = Σm(4,5,6,8,9,10,14)

(c) f(A,B,C,D) = Σm(0,1,2,3,6,7,14,15)

(d) f(A,B,C,D) = Σm(0,1,2,3,7,11,15)

(e) f(A,B,C,D) = Σm(4,5,6,8,9,10,12,13,14)+X(7,11)

Q6.      Which of the following logic functions is implemented by the given circuit?

 

MUX 8x1 (1 bit)

 

0   1   2   3   4   5   6   7

D  0   0   D, D   1   D,  1              (e) f(A,B,C,D) = Σm(1,6,9,10,11,12,14,15)

Q7.      What is the capacity of a ROM, capable to implement three functions of six variables?

(a) 8 words of 6 bits       (b) 16 words of 3 bits        (c) 32 words of 6 bits           (d) 64 words of 3 bits

(e) None of the above

Draw a block diagram of your memory with the major components, indicating its inputs and outputs.

Q8.

1)        - Draw the state diagram of the sequential circuit whose state table is given below

Present        Next                                                                               The State Diagram goes here:

State          state

 

CEG2136/CEG2536 Computer Architecture I Architecture des ordinateurs I MIDTERM EXAMINATION

A B C

A+B+C+

JA

KA

JB

KB

JC

KC

0 0 0

1 0 0

 

 

 

 

 

 

0 0 1

1 1 0

 

 

 

 

 

 

0 1 0

0 0 1

 

 

 

 

 

 

1 0 0

0 1 0

 

 

 

 

 

 

1 1 0

0 0 0

 

 

 

 

 

 

- Fill out the above table with the appropriate values for the JK flip-flops inputs such that the sequential circuit will observe the required transitions.

- Indicate the correct set of minimized equations of the JK flip-flops inputs from the following:

(a) J A = A,B,, (b) J A = A,B,, (c) J = B,,

(d) J A = A,B,, (e) J = B,,

K= C,, K= 1,   K= 1,   KA = A,  KA = A,

JB = AB’C’+ A’B’C,

JB = A+C, JB = A+C, JB = AC,   JB = AC,

KB = BC,, K= 1,

K= 1,   KB = C,, KB = C,,

JC = A’BC  JC = A,B,    JC = A,B,    JC = A,BC, JC = A,BC,

KC = A’B’C. K= 1.

K= 1.   KC = A,. KC = A,.

2)        - If your circuit reaches by mistake any of the 3 states that are not used, determine their corresponding next state.

Present state

Next State

 

 

 

 

 

 

- Is your circuit auto-corrective?        Reply just with YES or NO

Draw the time diagram and give the states of the flip-flops’ outputs through the first 6 clock pulses, assuming that their initial state (at t=0) is 000 and they are triggered on  the rising edge of the clock         

先展示下效果 https://pan.quark.cn/s/a4b39357ea24 遗传算法 - 简书 遗传算法的理论是根据达尔文进化论而设计出来的算法: 人类是朝着好的方向(最优解)进化,进化过程中,会自动选择优良基因,淘汰劣等基因。 遗传算法(英语:genetic algorithm (GA) )是计算数学中用于解决最佳化的搜索算法,是进化算法的一种。 进化算法最初是借鉴了进化生物学中的一些现象而发展起来的,这些现象包括遗传、突变、自然选择、杂交等。 搜索算法的共同特征为: 首先组成一组候选解 依据某些适应性条件测算这些候选解的适应度 根据适应度保留某些候选解,放弃其他候选解 对保留的候选解进行某些操作,生成新的候选解 遗传算法流程 遗传算法的一般步骤 my_fitness函数 评估每条染色体所对应个体的适应度 升序排列适应度评估值,选出 前 parent_number 个 个体作为 待选 parent 种群(适应度函数的值越小越好) 从 待选 parent 种群 中随机选择 2 个个体作为父方和母方。 抽取父母双方的染色体,进行交叉,产生 2 个子代。 (交叉概率) 对子代(parent + 生成的 child)的染色体进行变异。 (变异概率) 重复3,4,5步骤,直到新种群(parentnumber + childnumber)的产生。 循环以上步骤直至找到满意的解。 名词解释 交叉概率:两个个体进行交配的概率。 例如,交配概率为0.8,则80%的“夫妻”会生育后代。 变异概率:所有的基因中发生变异的占总体的比例。 GA函数 适应度函数 适应度函数由解决的问题决定。 举一个平方和的例子。 简单的平方和问题 求函数的最小值,其中每个变量的取值区间都是 [-1, ...
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值