作者love5566188 (I'dont kown)
看板Grad-ProbAsk
標題[理工] [計組]-清大100-資工
時間Fri Jan 27 12:03:09 2012
http://www.lib.nthu.edu.tw/library/department/ref/exam/eecs/cs/100/2202.pdf
想請問一下第八題
8.
Given an 8-bit zero-fill left-shift as below that has 8 input bits X=X7..X0
, 8 output bits Y=Y7..Y0, and a 3-bit shift-amount-control C=C2C1C0. For
example, when X=10110011 and C=011, the input will be left-shifted by 3 bits
and three vacant bits are filled with zeros to get Y=10011000. Add some
circuit to the shifter so that it become a zero-fill left/right shifter
capable of both left-shift and right-shift operations with X',X' and C'as
its input, output, and shift-amount, respectively. An additional bit called
"Mode" selects the shift direction "0" for left shift and "1" for right
shift.
他給的圖:
↓↓↓↓↓↓ X'
——————————————————————
∣Zero-Fill Left/Right Shifter ∣
∣ ∣
∣ ↓↓↓↓↓↓X ∣
∣ ———————————— ∣
∣ ∣ ∣ ∣
∣ ∣Zero-Fill Left-Shifter∣ ∣
∣ ∣ ∣← ∣←
∣ ∣ ∣← ∣←
∣ ∣ ∣← ∣←
∣ ∣ ∣← ∣←
∣ ∣ ∣C ∣C'
∣ ———————————— ∣
∣ ↓↓↓↓↓↓Y ∣
—————————————————————— Mode
↓↓↓↓↓↓Y'
請問高手這題要怎麼下手?
(抱怨一下:清大100年真的是..WTF..)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 175.98.50.200
→ love5566188:結果沒人解>"< 01/27 23:56
→ metalalive:這題之前也是想不到,看好久才知道 , left-shifter是題 01/28 11:13
→ metalalive:目已知,SO不用再重新設計,所以題目就只要你新增mode 01/28 11:14
→ metalalive:bit 使得這個shifter 可同時支援 left/right shift 01/28 11:15
→ metalalive:即可 01/28 11:18
→ metalalive:關鍵想法就是shift right功能相當於把input bit string 01/28 11:19
→ metalalive:反轉過來->執行left shifter-->再反轉一次-->output 01/28 11:21
→ metalalive:btw 把input string 反轉的功能可以用multiplexer設計 01/28 11:24
→ love5566188:有想法了,謝謝m大 01/28 12:22
推 AllenPaul: 講解好精闢!! 01/07 18:54