NTU-Exam 板


LINE

课程名称︰计算机组织与组合语言 课程性质︰资工系必修 课程教师︰庄永裕 开课学院:电资学院 开课系所︰资讯工程学系 考试日期(年月日)︰97年10月27日(2008.10.27) 考试时限(分钟):两个多小时 是否需发放奖励金:是 (如未明确表示,则不予发放) 试题 : 除了考题还有另外一张拿来画第6题的答案卷,上面有附上第9题拿来解释stack的图, 还有一个TOY reference card。 就是TOY machine的machine code的format表, 和opcode对应的operation、format、pseudocode的表。 ˙ Use * to represent the irrelevant values and the values not specified in the question. ˙ Please use the following notations for logic gates. Feel free to change the orientations of the gates and the positions of inputs and outputs. You are free to use other circuits. However, if they are not introduced in the class, you have to implement them before using them. 图就不画了,有AND/OR/NOT、k-bit full adder、k-wide n-to-1 multiplexer、 n*k register、k-bit comparator。 1. (8%) What are the 8-bit 2's complement representations of the following decimal numbers? Please give both their binary and hexadecimal representations. a. 97 b. -21 _ 2. (10%) Prove (a) A(A + B) = AB and (b) A + AB = A + B both algebraically and using the truth table. 3. (10%) Implement a circuit to realize the divided-by-2 and divided-by-3 functions. The divided-by-2 function D2 outputs 1 if the input X can be divided by 2, that is, X%2 = 0. For example, if X is 101, D2 = 0 because 5%2 ≠ 0. Similarly, D3 output 1 if X%3 = 0; 0 otherwise. Assume 3-bit inputs X = X2 X1 X0. Write down the truth table, corresponding logic expressions and logic gate inplementations for D2 and D3. 有个Figure 1: Encoder, sorter and max-min. 4. (10%) A 4-to-2 encoder (Figure 1(a)) has four inputs A3, A2, A1, A0 and two outputs Z1, Z0. Only one of the four inputs can be 1 at a time. Assume that Ai is on, the output (Z1, Z0) will correspond to the binary representation of i. For example, when input A2=1, Z1 Z0 = 10. Write down the truth table for the 4-to-2 encoder and implement it with logic gates. 5. (15%) (a) A 4-bit 2-sorter(Figure 1(b)) has two 4-bit inputs A, B and two 4-bit outputs X, Y. The inputs A and B are unsigned integers. The output X is the larger one of A and B and Y is the smaller on of A and B. Design a 4-bit 2-sorter. (b) A 4-bit 3-sorter (Figure 1(c)) has three 4-bit inputs A, B, C and three 4-bit outputs X, Y, Z, where X, Y and Z are the result of sorting A, B, C so that X ≧ Y ≧ Z. Use 4-bit 2-sorters to composite a 4-bit 3-sorter. (c) A 9-maxmin(Figure 1(d)) has nine 4-bit unsigned inputs Xi, i=1..9 and two 4-bit outputs MAX and MIN where MAX = max(Xi). and MIN = min(Xi). Implement 9-maxmin. 有个Figure 2: TOY architecture. 6. (10%) Draw the required datapath on page 4 for instruction fetch and the set of instructions {"xor","store","branch zero" and "jump and link"}. Only the necessary part but not the whole TOY datapath. Add multiplexers if necessary. Remember to return page 4 with your answer sheet. 7. (12%) Refer to the TOY architecture (Figure 2), please specify the operations of MUX_PC, MUX_MEM, MUX_REGR, MUX_ALU, MUX_REGW, WRITE_REG, WRITE_MEM and ALU_OP during the execution stage for the instructions "and", "load addr", "store indirect" and "branch zero". For example, the answer for "jump and link" would be MUX_PC = 1, MUXMEM = *, MUX_REGR = *, MUX_ALU = 1, MUX_REGW = 01, WRITE_REG = 1, WRITE_MEM = 0, ALU_OP = *. 8. (10%) Write a TOY program to print out the positive powers of 2 that can be represented by TOY, 1, 2, 4, 8, ... 9. (15%) Design a circuit to implement a 16 * 8 stack (Figure 3(a)). There are 16 words in the stack and each word is 8-bit. A stack is a data structure based on the principle of Last In First Out(LIFO). Two operations can be used to change the content of the stack. "Pop" removes an element from the top and 'push' adds an element at the top. A pointer "top" always points to the top valid element of the stack. For example, Figure 3(b) shows an empty stack. Initially, the top points to 1111 since the stack is empty and there is no valid element. In Figure 3(c), "push 1" will add an element into the stack and the top is updated to 0000, the address of the first valid element. In Figure 3(d), "push 2" will add an element into the stack and the top is updated to 0001. In Figure 3(e), "push 3" will add an element into the stack and the top is updated to 0010. In Figure 3(f), "pop" will remove the top element and the top is updated to 0001. Two 1-bit inputs W and op determines the operation of the stack circuit as the following. There are four operations. Other than push and pop, "read" reads the content of the top element without modifying the stack. "top" reads the content of the top pointer. In addition, the stack has an 8-bit input as the W Date for specifying the element to be written with the push command. There is also an 8-bit output R data for the data to be read out. (Ignore the issue of wrap-around.) W op operation semantics 0 0 read the content of stack[top] can be read from "R data" 0 1 top the content of top can be read from "R data" 1 0 push top++; write the "W data" to stack[top]; 1 1 pop top--; 另外,是openbook的。 --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.31.138.32 ※ 编辑: a127a127 来自: 61.31.138.32 (11/17 12:21)
1F:推 hank5925 :是openbook没错 11/17 19:54
感谢补充<(_ _)> ※ 编辑: a127a127 来自: 219.81.146.231 (11/18 01:31)







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Gossiping站内搜寻

TOP