You can emulate anything on a microcontroller if you're determined enough. It just won't run as fast as you might want.
You could certainly use a microcontroller to implement arbitrary digital (or even analog) logic within a circuit. You'll be limited by the CPU speed. The trick is to avoid interrupts, and spin the CPU in a tight poll loop instead. An Arduino Uno's MCU can run an instruction perhaps every 150ns on average. You could implement some simple logic that runs upwards of 1Mhz. If you use a cortex-m CPU, you could do fairly complex logic at several Mhz.
That's a silly way to use an MCU, though. You're supposed to use the peripherals to offload enough complexity from the CPU that you have plenty of cycles to implement your application logic in a straightforward, maintainable way.
> You can emulate anything on a microcontroller if you're determined enough. It just won't run as fast as you might want.
You can absolutely compile Verilog to C using Verilator and run it on a microcontroller. The performance is abysmal, and it completely misses the point of using HDL, but it does work. :)
You could certainly use a microcontroller to implement arbitrary digital (or even analog) logic within a circuit. You'll be limited by the CPU speed. The trick is to avoid interrupts, and spin the CPU in a tight poll loop instead. An Arduino Uno's MCU can run an instruction perhaps every 150ns on average. You could implement some simple logic that runs upwards of 1Mhz. If you use a cortex-m CPU, you could do fairly complex logic at several Mhz.
That's a silly way to use an MCU, though. You're supposed to use the peripherals to offload enough complexity from the CPU that you have plenty of cycles to implement your application logic in a straightforward, maintainable way.