This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require "tiny-hdl-macros.rkt") | |
(entity half-adder ([input a] [input b] [output s] [output co])) | |
(entity full-adder ([input a] [input b] [input ci] [output s] [output co])) | |
(architecture half-adder-arch half-adder | |
(assign (port-ref half-adder s) (xor (port-ref half-adder a) (port-ref half-adder b))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require | |
syntax/parse/define | |
(for-syntax racket/syntax)) | |
; Define an instance of a structure: | |
; - name: the name of the instance | |
; - sname: the name of the struct type | |
; - arg ...: the arguments for the struct type constructor |
OlderNewer