作者sasako (只想把你留在心中)
看板Electronics
標題Re: [問題] 請問這樣的觀念對嗎(verilog HDL)?
時間Mon Aug 25 21:53:01 2008
※ 引述《Vampirespit (Vampirespit)》之銘言:
: 假如說我1個大模組
: 裡面包了5個正緣觸發的小模組
: (也就是說有五個模組各負責其功能 但都是正緣觸發)
: 意示圖↓
: ─────────────────────────────
: 大模組( 輸入時脈clk )
: {
: 小模組1(正緣觸發) outputI=inputI+1
: 小模組2(正緣觸發) outputII=inputII-2
: 小模組3(正緣觸發) outputIII=inputIII*3
: 小模組4(正緣觸發) outputIV=inputIV/4
: 小模組5(正緣觸發) outputV=inputV+5
: }
: ─────────────────────────────
: 想法一.↑上圖大模組內的接線已省略 功能則是從小模組1接至小模組5
: 完成 outputV= { [(inputI+1-2)*3]/4]+5 } 的方程式
: 請問這樣是不是這個大模組已經有pipeline的功能了呢?
: (也就是說 outputV= { [(inputI+1-2)*3]/4]+5 } 要5個clk後才會出來?)
: 想法二.
: 還是說當正緣觸發時
: 那5個小模組也會 "一起" 被正緣觸發而動作?(i.e.沒有pipeline?)
: (也就是說 outputV= { [ [ (inputI+1-2)*3] /4] +5 } 1個正緣觸發就出來了?)
: 可以請你們幫我澄清一下觀念嗎?
: 謝謝你們的收看 ╭(╴"╴)╮
這個嘛!五個output各自獨立作自己的運算,一個正緣後,你會得到五個值...
說真的,不太想給你正確答案,你應該從書中獲得觀念...
舉個例子,你自己舉一反三吧...
....宣告自己想辦法
assign c = a + b ;
assign e = register_1 + d ;
always (posedge clk or negedge n_rst) begin
if(!n_rst)begin
register_1 <= 0 ;
end
else begin
register_1 <= c ;
end
end
always (posedge clk or negedge n_rst) begin
if(!n_rst)begin
register_2 <= 0 ;
end
else begin
register_2 <= e ;
end
end
這樣就是插了兩排register在output處
有些人喜歡插在input,看習慣...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.15.152
推 Vampirespit:為什麼說一個正緣後會得到五個值壓...@Q@ 08/25 22:25
→ Vampirespit:那些小模組有連在一起耶XD... 08/25 22:26
推 bakerly:給你兩個建議 1.隨便找本arm的書都會講到pipelin的觀念, 08/26 09:48
→ bakerly:有附圖比較好懂。 2 先把什麼是同步邏輯搞懂再來看這個問 08/26 09:50
→ bakerly:題會比較好。 08/26 09:50