Re:Fonts extracted from BIOSes and VGA ROMs
by willis936 on Friday May 15, 2020 @03:21PM
(#23196253)
So I went on a bit of a rabbit hole on this one. The above code is wrong. I have since fixed it. It's the same idea with some added terms to normalize for data size.
Word size matters when calculating entropy. Calculating entropy on this file using 2 to 64 bits nets a minimum information of 860 bits using a 64 bit word size. Moving past a 64 bit word size requires rethinking some things. MATLAB doesn't have great support for data sizes greater than 64 bits (and I'm certain the performance impact would be great).
words = double(unique(X))';
binEdges = [words-0.5; words+0.5];
binEdges = unique(binEdges(:));
P = histcounts(X, binEdges) / M;
P(P == 0) = [];
M = numel(X);
H = -sum(P .* log(P) ./ log(max([nBits, 2]))) / nBits * log2(max([nBits, 2]));
E = H * M * nBits;
Re:Fonts extracted from BIOSes and VGA ROMs
by perl4ever on Thursday May 14, 2020 @07:26PM
(#23186925)
Counterpoint, 2^638 is a large number. So a particular 638 bits is very particular.
Re:Fonts extracted from BIOSes and VGA ROMs
by willis936 on Friday May 15, 2020 @03:18PM
(#23196219)
This is meaningless. Information is information. Specifying a size has virtually no information. The number "638" stored in uint16 has two bits of information using any word size between 8 and 15 bits.
Looking at the actual IBM_VGA_8x8.bin file: the file size is 1024 bytes (8192 bits). I calculated the entropy of the data to be only 638 bits of information.
MATLAB code: