This gets brought up every time the topic shows up but https://www.nand2tetris.org is a course that abstracts how a computer works, and is worth checking out
Like, emulate gates and keep building bigger pieces until you have a function that’s a CPU. Etc.
I guess I’m thinking a bit more lower level than an emulator where you implement an opcode using normal capabilities of your language of choice.
I guess TFA is pretty close to this in ways, too.
hardcover:
https://www.lulu.com/shop/gerg%C5%91-%C3%A9rdi/retrocomputin...
or digital:
Much faster than Logisim, UI a little clunky, but my CPU runs around 0.5Mhz and it has very nice peripherals like Telnet, graphics ram, VGA etc
Terrible name that is hard to google, but great tool.