1 / 15

プロジェクト実習 LSI の設計と実現

プロジェクト実習 LSI の設計と実現. LSI 設計入門. 論理回路 論理関数、ブール代数 真理値表 C 言語 ビット演算(論理和、論理積、排他的論理和) 3 項 演算子( X = A ? B : C ). プロジェクト実習 LSI の設計と実現. 順序回路の設計. マルチプレクサ. マルチプレクサ. もう一つの書き方 assign out=( sel ==1’b1) ? B : A; 以下はイメージ if( sel ==1’b1) assign out=b else assign out=a. 乗算器.

Download Presentation

プロジェクト実習 LSI の設計と実現

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. プロジェクト実習LSIの設計と実現

  2. LSI設計入門 • 論理回路 • 論理関数、ブール代数 • 真理値表 • C言語 • ビット演算(論理和、論理積、排他的論理和) • 3項演算子( X = A ? B : C)

  3. プロジェクト実習LSIの設計と実現 順序回路の設計

  4. マルチプレクサ

  5. マルチプレクサ • もう一つの書き方 • assign out=(sel==1’b1) ? B : A; 以下はイメージ if(sel==1’b1) assign out=b else assign out=a

  6. 乗算器 sum=(b[0]==1’b1) ? sum+a : sum; a=a<<1’b1; sum=(b[1]==1’b1) ? sum+a : sum; a=a<<1’b1; sum=(b[2]==1’b1) ? sum+a : sum; a=a<<1’b1; sum=(b[3]==1’b1) ? sum+a : sum; • 基本的な考え方は合っているが重大な問題が

  7. wire(=配線) • 複数回代入してはいけない • ループしてもいけない • reg(=記憶素子) • 複数回代入してはいけない • ループは良い • reg <= reg+1

  8. クロックのあるテスト回路 `timescale 1ns/1ps always begin #40 clock = ~clock; end initial begin clock=0; a=0; b=0; #100 a=1’b1 #100 b=1’b1 end

  9. 順序回路 • レジスタの仕様を把握する • 「現在の状態」から「次の状態」を組合せ回路で記述する 現在の状態 • レジスタ • input 次の状態 • always中の右辺値(左辺はreg変数)

  10. 順序回路 組合せ回路 Reg Reg

  11. Verilogルール • always @(posedge clock or negedge reset) begin • if(reset==1’b0) begin • /*initialize*/ • end else begin • /*code*/ • end • end • この形を変えてはいけない

  12. if(reset==1’b0) begin • x<=0; • end begin begin • if(xxx) begin • x<=1; • end else begin • x<=y; • end • end • 左辺はXのみ • どんな条件でもXに代入されるのは1回(または0回) • 複数のalwaysからXに代入してはいけない

  13. イネーブル付きカウンタ • ステートマシンとカウンタを組み合わせる • ステートが???のときのみにカウントする • Xのパルス幅がクロックよりも十分長い時にどうなるか?

  14. ストップウォッチ • ステートマシンを考える • 入力は2つ(左右のボタンに相当) • 4状態では無理 • 押した瞬間からカウントを始め、押した瞬間に停止すること • 離した時にはカウンタに変化がない

  15. ヒント • カウント用とラップ用のレジスタが必要 • 切替は • assign out put(条件)? count : lap;

More Related