Hỏi & Đáp
[L1-P16 clog2 with memory] clog2 function 질문
안녕하세요 ETA님 바쁘신데 답변 감사드립니다. 아래는 전체 저의 코드입니다. 모범 답안에서 차이점은 clog2 function 부분 밖에 없습니다. `timescale 1ns / 1ps // Design a module according to the following requirements // Memory size: Width: 8 bits, Depth: DEPTH(parameter) // Design a clog2 function (calculate log base 2 and round up). The clog2 is used for the address width. // The memory interface operation should follow the timing diagram shown below. module clog2 #( parameter DEPTH = 256 )( input wire clk, input wire rst, input wire we, input wire [clog2(DEPTH)-1:0] addr, input wire [7:0] din, output reg [7:0] dout ); //TODO function integer clog2(input DEPTH); begin if(DEPTH == 1) begin clog2 = 0; end else if(DEPTH >= 2 && DEPTH = 4 && DEPTH = 8 && DEPTH = 16 && DEPTH = 32 && DEPTH = 64 && DEPTH = 128 && DEPTH = 256 && DEPTH = 512 && DEPTH 해당 코드 컴파일 시 컴파일 에러는 발생하지 않습니다. 혹시 컴파일 에러를 공유해주실 수 있을지 질문 드리고 싶습니다.. 추가로 현재 제가 사용하고 있는 xilinx version은 2020.2입니다. 하지만 xilinx version에 따라 컴파일 에러가 달라질 거라고 생각은 하지 않지만, 일단 공유 드립니다. 감사합니다.
- Lượt thích
- 1
- Số bình luận
- 4
- Lượt xem
- 115

