#Fast Logic Circuit
18 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
What is the most efficient way to simulate logic circuits
Handwritten assembly, optimized for the specific hardware/software combination you're programming on, but you probably don't want to do that.
and i need to generate, evaluate, modify and destroy them extremly quickly for my project
Can you go into a little bit more detail? Cause right now I don't understand why it couldn't just be a function, like e.g.:
static inline nand(bit a, bit b) {
return !(a & b);
}
```(of course there is no `bit` datatype, but we could just use `unsigned char` instead, then do some bit manipulations if required)
If you need fast dynamic alloc maybe use memory pool?
typedef enum bit {
FALSE = 0, TRUE = 1
} bit;

allat when bool exists
depends, older C versions dont have a bool type as a language feature
i don't want to touch any C version that doesn't have bool in it. didn't stdbool.h come out in C99? ANSI C is just painful. but yeah, if all you got is ANSI C, you'd need that
C doesn't have language level bool until C2x
guess i don't understand what "language level" means in this context then
part of the language
not the standard library
oh, so you mean it's in by default rather than in a header? in that case, C23 has bool as a keyword, and that superseded _Bool as a keyword, which was introduced in C99 and deprecated in C23
if alloc sucks, pre alloc
VirtualAlloc the whole address space
Problem solved
virtual memory being a pain.. just run your own bare metal OS