Arrayto16
Misc is a package in Java™ Implementation of nand2tetris. It contains basic utilites and reusable codes for creation and modification of chips and its outputs.
Arrayto16 Method in class Convert
public static int[] Arrayto16(int[] in) {
int[] inp16 = new int[16];
System.arraycopy(in, 0, inp16, 0, in.length);
// arraycopy is used so that leading zeros is present
return inp16;
}Last updated