Logic circuits simulation