Memory Management
Today I implemented a Popup window that displays the contents of a Memory device. The view is like a typical hex memory dump of the data bytes against memory addresses.
You may also specify the size of the memory and the word width (8/16 bits).
One of the challenges was how to present the data. First I used a grid of Labels or LineEdit nodes, but the LineEdit nodes have an undesirable minimum width that was too large. And there ended up with numerous nodes.
So the next idea was to simply use one Label and populate it with text. This made it easy to output the data and switch views between hex and binary.
But, it would be nice to be able to edit the memory values. This entailed the need to detect the mouse position and relate this to a memory address. I also changed the mouse cursor to a pointing hand since there was no highlighting going on.
I used a mono-spaced font, so this allows for consistent distances between points. Clicking on a data byte value opens a popup that allows for changing the data value.
First I created an edit box for entering the byte value in binary or hex. However, this didn’t seem right with only one character of hex to edit. Also, the entered values need to be validated for allowed values on each change.
A far simpler approach was taken where it was realized that there are only 16 possible byte values, and we may as well simply display the available choices in a grid of buttons. Furthermore, it is trivial to display the values as decimal, hex, and binary.
Oops! No, a 4-bit nibble has 16 possible values. I change this later on in the journey :-)
Editing the value at address zero.
Pressing one of the buttons changes the value and closes the popup. Also, the current value button grabs focus.
This tool is only meant for very basic memory management. It’s likely, in the future to use say an external code editor to create the byte array. This data would be imported into a memory part. The data will be saved in the circuit with the memory part.
To do
- Integrate the memory data with memory part
More Devlog entries
Most recent first
- 2021 10 02 New Release of Digital Logic Simulator
- 2021 08 28 Nested Sub Blocks
- 2021 08 27 Debugging with a log file
- 2021 08 26 Testing Circuit Blocks
- 2021 08 24 Bug Fixing with Blocks
- 2021 08 22 Debugging Circuit Blocks
- 2021 08 21 Circuit Blocks Update
- 2021 08 18 Circuit Blocks
- 2021 08 16 Highlighting of wires
- 2021 08 12 Adding Tutorial Content
- 2021 08 07 Numbers Scene
- 2021 08 06 Numbers Tabbed Scene
- 2021 08 04 Number Display Widget
- 2021 07 26 Logic Simulator Update
- 2021 07 24 - Launch of V1.0
- 2021 07 23 - Truth Tables
- 2021 07 22 Progress Update
- 2021 07 21 - Simple Computer Simulation
- 2021 07 16 - Community Forum
- 2021 07 15 - Community News
- 2021 07 11 - Save and Load ROM Data
- 2021 07 09 - Documentation About The Logic Simulator
- 2021 07 08 - Big Progress
- 2021 07 07 - RAM and ROM Testing Complete
- 2021 07 06 - Implementing Tests
- 2021 07 05 - Cool algorithm for binary text string
- 2021 07 04 - Debugging Complex Situations
- 2021 06 30 - End of June - Refactoring Continues
- 2021 06 29 Community
- 2021 06 28 Implementing More OOP
- 2021 06 27 Memory Parts
- 2021 06 26 Improving the Memory Manager
- 2021 06 25 Memory Data
- 2021 06 23 First Devlog Entry