Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Thu Feb 01, 2018 1:37 am |
|
|
A decimal, is a 4bit integer. Just only uses 10 of the possible 16 values.
The same answer applies as for the post only a few days ago. Just use the +. However as was said in that thread, if you want to synthesise it to see the operation step by step, then you have a choice of synthesising using logic, or serial synthesis (bit by bit in sequence).
For the logic solution look at:
<https://stackoverflow.com/questions/14695051/how-to-simulate-a-4-bit-binary-adder-in-c>
This also starts to talk about the serial solution.
A discussion of this is here:
<https://www.safaribooksonline.com/library/view/introduction-to-digital/9780470900550/chap9-sec016.html>
The _real_ way to do this, is to draw the state table, and then show how you generate the required patterns using logic. This is how you would design a logic circuit for _any_ similar problem, and would be the solution you would be expected to actually show.
However this question is off topic. This is a group for questions about things to do with the CCS compiler. This is nothing to do with the CCS compiler. |
|