Computer-aided design of digital optical circuits