HDLBits - Vector1
·
HDLBits/Verilog
Vector 선언type [upper:lower] vector_name;Implict Nets - 암시적 Nets 방지하기`default_nettype nonePacked Arrayreg 타입 256-bit mem 변수를 총 8개 선언한 것reg [7:0] mem [255:0]Vector assignwire [7:0] w;와 output [3:0] a가 있을때assign w = a;를 하면 8-bit w wire에 4-bit a가 할당된다고 보면된다.bit수가 다를때 빈자리는 0으로 채워지고 모자란다면 잘려진다.설명은 여기서 끝이고이제 문제를 보자Build a combinational circuit that splits an input half-word (16 bits, [15:0] ) into lowe..
Verilator 설치
·
Hardware/ETC.
이전에 갑자기 WSL을 설치한 이유 -> Verilator를 쓰기 위해Verilator란?SystemVerilog 컴파일러 라고 한다설치방법필요 프로그램 설치sudo apt-get install help2mansudo apt-get install git make autoconf g++ flex bisonsudo apt-get install libfl2 sudo apt-get install libfl-devVerilator 레포지토리 Clonegit clone https://git.veripool.org/git/verilatorVersion 선택 -> 별 생각없이 선택한 Ubuntu 24.04에서는 5.020을 지원한다는 정보를 나중에 발견...https://repology.org/project/veri..
Windows 11 - WSL 설치 및 세팅
·
Hardware/ETC.
Windows Terminal 사용Windows Store에 가면 Terminal이 따로 있는데 기능이 추가된 버전이니 사용해보자WSL 설치Powershell에서 실행실행 후 재부팅wsl.exe --install원하는 배포판 확인wsl.exe --list --online설치wsl.exe --install -d Ubuntu-24.04이름, 패스워드 등 설정 후패키지 미러 주소 변경sudo sed -i 's/archive.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list.d/ubuntu.sources패키지 업데이트 + 업그레이드 + 자동제거sudo apt update && sudo apt -y upgrade && sudo apt -y autoremoveZSH 설치..
HDLBits - Vectors
·
HDLBits/Verilog
Vector의 사용법에 대해 알아보는 문제input [2:0] vec이 있을때,각각의 vector를 하나씩 output으로 선언할 수도 있고,통째로 원하는 만큼 선언도 가능하다.쉽게 보면 C언어의 배열? 같은 느낌인데Wire를 묶어서 생각하면 된다고 나는 이해했다.module top_module ( input wire [2:0] vec, output wire [2:0] outv, output wire o2, output wire o1, output wire o0 ); // Module body starts after module declaration assign outv = vec; assign o2 = vec[2]; assign o1 = vec[1]; ..
노력, 방법
·
생각
내가 어디까지 알고 있고 모르는지를 다시 확인해보기 전까지는 알 수가 없다.어쩌면 그 확인하는 방법이 더 오래 걸리고 힘들지라도 더이상 미루면 사상누각이 될 것 같아 블로그를 시작했다.
HDLBits - 7458 chip
·
HDLBits/Verilog
7458 chip 내부의 회로를 구현 하라는 문제그림을 잘보고 하나하나 만들어가면 크게 어렵지않다.좌측은 and gate들이 입력 2개를 받고 우측은 and gate들이 입력 3개를 받는 것만 유의해서 짜면 될것같다. 이로써 Verilog-Language의 Basics 챕터가 끝났다~module top_module ( input p1a, p1b, p1c, p1d, p1e, p1f, output p1y, input p2a, p2b, p2c, p2d, output p2y); wire w_and_1, w_and_2; wire w_tri_and_1, w_tri_and_2; wire w_or_1, w_or_2; assign w_and_1 = p2a & p2b; a..
HDLBits - Declaring wires
·
HDLBits/Verilog
이번 문제는 Wire의 사용법에 대해 배우는 문제인듯하다.`default_nettype nonemodule top_module( input a, input b, input c, input d, output out, output out_n ); wire w_and1; wire w_and2; wire w_or1; assign w_and1 = a & b; assign w_and2 = c & d; assign w_or1 = w_and1 | w_and2; assign out = w_or1; assign out_n = ~w_or1;endmodule
HDLBits - AND gate / NOR gate / XNOR gate
·
HDLBits/Verilog
기본적인 문제라서 그냥 한번에 하기로 했다지난번에 한 NOT 까지 합치면NOT / AND / NOR / XNOR 순으로 문제가 나와있다.Bitwise 연산자와 Logical 연산자는 비슷하지만 다름!Bitwise(Bit 연산)NOT: b = ~aAND: c = a & bOR: c = a | bXOR: c = a ^ bLogical(True, False)NOT: b = !aAND: c = a && bOR: c = a || bXOR: 없음이번엔 a 와 b의 입력을 AND gate로 묶어서 out으로 출력하는 문제module top_module( input a, input b, output out ); assign out = a & b;endmodulea, b 입력을 NOR gate..