⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entropyencoder.v

📁 encoder jpeg project
💻 V
字号:
module  EntropyEncoder  ( DataIn, 
                          Clock, 
                          Reset, 
                          Enable, 
                          Start, 
                          EndData, 			       
                          DataOut, 
                          ValidOutput, 
                          ReadyOut
                        );

//            MODULE INPUTS                     
input         Clock;              // Clock signal 
input         Reset;              // System wide low asserted reset
input         Start;              // Indicates beginning of valid data
input         EndData;            // indicates end of valid data
input         Enable;             // System wide enable signal
input [10:0]  DataIn;             // Data input to the entropy encoder

//            MODULE OUTPUTS
output        ValidOutput;        // Indicates output of valid results
output [15:0] DataOut;            // Compressed data output
output        ReadyOut;           // Indicates if new data can be input
              
//            INTERNAL WIRES
wire [11:0]   CoeffOut;
wire [10:0]   Coefficient2; 
wire [10:0]   Coefficient3;
wire [3:0]    ZCout; 
wire [3:0]    Runlength2; 
wire [3:0]    Runlength3; 
wire [3:0]    Category2; 
wire [3:0]    Category3;

// Instantiations of components modules of the entropy encoder

FlushLogic flogic ( Reset, 
                    Clock, 
                    Enable, 
                    EndData, 
                    Flush, 
                    LastData, 
                    ReadyIn, 
                    ReadyOut
                   );

zerorunlengthcoder ZRLC ( DataIn, 
                          Clock, 
                          Reset, 
                          Start, 
                          Enable, 
                          EndData, 
                          DC1, 
                          AC1, 
                          ZRL1, 
                          EOB1, 
                          EOB2, 
                          ZCout, 
                          CoeffOut
                        );

categoryselect CatSelect ( CoeffOut, 
                           ZCout, 
                           DC1, 
                           AC1, 
                           EOB1, 
                           EOB2, 
                           ZRL1, 
                           Clock, 
                           Enable, 
                           Category2, 
                           Coefficient2, 
                           Runlength2,
                           DC2, 
                           AC2, 
                           EOB12, 
                           EOB22, 
                           ZRL2
                         );

Stripper StripLogic(Coefficient2, 
                Runlength2, 
                Category2, 
                DC2, 
                AC2, 
                EOB12, 
                ZRL2, 
                EOB22,
                Flush, 
                Clock, 
                Reset, 
                Enable,
                Coefficient3, 
                Runlength3, 
                Category3, 
                DC3, 
                AC3, 
                EOB3, 
                ZRL3, 
                EOB23,
                LoadControl);

HuffmanEncoder HuffCoder ( Coefficient3, 
                           Category3, 
                           Runlength3, 
                           DC3, 
                           AC3, 
                           EOB3, 
                           EOB23, 
                           ZRL3, 
                           Huffman, 
			      CategoryOut, 
                           RunLengthOut, 
                           CoefficientOut, 
                           EOB, 
                           LoadControl, 
                           Clock, 
                           Reset, 
                           Enable, 
                           ValidCode
                       );
					
packer DataPacker ( Reset, 
                    Enable, 
                    Huffman, 
                    CoefficientOut, 
                    CategoryOut, 
                    Clock, 
                    ValidCode, 
                    EOB, 
                    LastData, 
                    DataOut, 
                    ValidOutput, 
                    ReadyIn
                 );

endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -