Minecraft HDL,一种红石硬件描述语言。
Minecraft HDL, an HDL for Redstone

原始链接: https://github.com/itsfrank/MinecraftHDL

Minecraft HDL 是由麦吉尔大学工程学生开发的一种数字合成流程,用于使用行业标准设计工具和 Verilog 代码创建 Minecraft 红石电路。该项目旨在在大型、可视化的规模上展示数字电路设计原理。 提供的示例 `multiplexer4_1.v` 是一个 6 输入、1 输出的电路,根据两个控制输入选择四个输入中的一个。虽然 Minecraft HDL 可以生成各种电路,但其输出目前受限于 Minecraft 的方块加载能力以及无法创建顺序(环路/基于内存)电路。 尽管生成的电路效率低于手工设计的电路,Minecraft HDL 仍然是一种教育工具,可向初学者介绍数字设计概念,并说明软件工程和硬件工程之间的区别。它是一个有价值的资源,可以可视化将代码转化为功能性硬件的过程。

## Minecraft 与硬件描述语言 一个名为 Minecraft HDL ([github.com/itsfrank](https://github.com/itsfrank)) 的新项目允许用户将硬件描述编译成 Minecraft 红石电路。这引发了 Hacker News 用户的讨论,许多人回忆起早期与红石打交道以及它令人惊讶的复杂性。 许多评论者分享了玩红石如何激励他们从事电气工程和 FPGA 设计的职业。虽然目前的实现还很基础——仅利用红石粉、中继器和火把——但用户承认它具有扩展潜力。一些人指出,它只是现有复杂红石装置的“侧级替代”,因为它没有考虑时序或高级技术。 对话还涉及了 RedPower 和 ComputerCraft 等相关项目,强调了 Minecraft 中长期存在的模组和计算构建历史。分享了资源,包括 Verilog CPU 实现和红石存储电路示例,证明了即使在编译器当前限制下,游戏中也能实现反馈循环。最终,该项目被认为是一种有趣但客观上无用的探索硬件描述语言的方式。
相关文章

原文

Minecraft HDL is a digital synthesis flow for minecraft redstone circuits. It is an attempt to use industry standard design tools and methods to generate digital circuits with redstone.

This file multiplexer4_1.v is a 6 input - 1 output circuit that selects one of the first 4 inputs (a, b, c, d) as the output based on the value of the last 2 inputs (x, y)

module multiplexer4_1 ( a ,b ,c ,d ,x ,y ,dout ); 
 
output dout ; 
input a, b, c, d, x, y; 
 
assign dout = (a & (~x) & (~y)) | 
     (b & (~x) & (y)) |  
     (c & x & (~y)) | 
     (d & x & y); 
endmodule 

When synthesized through Minecraft HDL it produces this circuit:

4to1mux

With the 6 inputs on the right and the single output on the left



MHDL_FLOW

MinecraftHDL was the final undergraduate design project made by three students in the Electrical, Computer & Software Engineering department at McGill University.

It is by no means bug-free or even complete; It produces objectively inferior circuits to 'hand-made' redstone designs, and is not intended to be used in modded survival. It can generate almost any verilog circuit, however only simple designs will actually be testable in-game since any moderately-complex design will end up being longer than the maximum number of blocks loaded in Minecraft.

Additionally, we are currently unable to synthesize sequential circuits, aka any circuits with a loopback or feedback. That means no memory, no counters or any circuit that could hold a state.

MinecraftHDL is an educational tool to illustrate on a macro-scopic scale how microelectronic digital circuits are designed and produced. It is a great way to introduce younger audiences to the world of digital design and can also be used to illustrate the difference between software and hardware design to undergraduate engineers taking their first RTL class.

Supervisor: Brett H. Meyer - Website
Students:    Francis O'Brien - Website
                   Omar Ba Mashmos
                   Andrew Penhale

2b7seg

A 2-bit 7-segment display decoder in action (the display itself was not generated by MinecraftHDL)

To show how easy it is to make a circuit with MinecraftHDL here is a gif of me creating a circuit, synthesizing, and generating it in minecraft in less than a minute!

2b7seg

The circuit I generate above is a 2bit adder. It takes two numbers of two bits and adds them. At the end of the gif I set both input numbers to '11' which is the binary representation of the number 3. Then I move to the output and we see that O3=1, O2=1, and O1=0, this gives the binary number '110' which is indeed 6.

联系我们 contact @ memedata.com