<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Devon Gilson</title>
    <description>The latest articles on DEV Community by Devon Gilson (@dgilson74).</description>
    <link>https://dev.to/dgilson74</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2918388%2F64fcf757-b276-438c-ad12-f57f5da8f54c.jpg</url>
      <title>DEV Community: Devon Gilson</title>
      <link>https://dev.to/dgilson74</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dgilson74"/>
    <language>en</language>
    <item>
      <title>CPU Simulator (Python)</title>
      <dc:creator>Devon Gilson</dc:creator>
      <pubDate>Tue, 08 Apr 2025 16:36:19 +0000</pubDate>
      <link>https://dev.to/dgilson74/cpu-simulator-python-j2e</link>
      <guid>https://dev.to/dgilson74/cpu-simulator-python-j2e</guid>
      <description>&lt;p&gt;The goal of this project was to create a simulation of a CPU written in Python code. I've created classes and functions that relate to the functionalities of a CPU, cache, and memory. Included in the project are two text files that hold the instructions for the CPU and another to hold data values for the memory_bus.&lt;/p&gt;

&lt;p&gt;The first class built was the CPU, it contains the an instance variable of cache and memory bus. The CPU has functions of read and write that allow the CPU to read from the cache and write to cache and memory bus.&lt;/p&gt;

&lt;p&gt;The second class created was the Cache. The cache has instance variables of size, cache, cache order. I used a dictionary to simulate cache storage and list to keep track of the order of access in cache order. The Cache contains the functions read and write, read will check if the address is in the cache if not it will be a cache miss. The write function will check if the cache is full, if it is then it will evict the least recently used item (LRU). Then write data to cache and track the order.&lt;/p&gt;

&lt;p&gt;Third is the MemoryBus class, which contains one instance variable memory and two small functions of read and write.&lt;/p&gt;

&lt;p&gt;Fourth is the Memory Class, it contains an instance variable of size, and memory. Memory is initialized to none. The read function will check if the size and address are true and will return the address of the memory. If false, will raise an index error ("Address out of bounds"). The write function follows the same logic except we will save memory address in the data variable.&lt;/p&gt;

&lt;p&gt;The last class is the Main class. First I created two functions load_instructions and load_memory_init to fetch and parse instructions and values from both files. The main function is where I loaded the instruction and memory bus file and created instances of all the classes that were created. The next step was to initialize the memory based on the memory bus text file and insert the values and each memory address. Then I look through the instruction text file, split the instructions and return the address as an integer. The next step is to look for the commands written in the instruction text file and to operate on those commands to complete the process. The commands are "FETCH", fetches the address and data value, "ADD" which will fetch and add data from address, and "STORE" that will store data at the address.&lt;/p&gt;

&lt;p&gt;This project is a great way to see the functionalities of a CPU, cache, and memory in a simplified way. There are ways to expand on this project which would be to implement an ISA (Instruction Set Architecture) that would use MIPS (Million Instructions Per Second) instructions. Overall, with this project you could gain a simplified understanding of the workings of a CPU.&lt;/p&gt;

&lt;p&gt;Thank you for reading,&lt;/p&gt;

&lt;p&gt;Here is a link to my code:&lt;br&gt;
&lt;a href="https://github.com/dgilson74/CPUSim" rel="noopener noreferrer"&gt;https://github.com/dgilson74/CPUSim&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezgvq5ug6ri1boecs55m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezgvq5ug6ri1boecs55m.png" alt="Image description" width="723" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
    </item>
    <item>
      <title>Movie Recommendation in Terminal (With Python)</title>
      <dc:creator>Devon Gilson</dc:creator>
      <pubDate>Mon, 24 Mar 2025 19:27:56 +0000</pubDate>
      <link>https://dev.to/dgilson74/movie-recommendation-in-terminal-with-python-28fp</link>
      <guid>https://dev.to/dgilson74/movie-recommendation-in-terminal-with-python-28fp</guid>
      <description>&lt;p&gt;Hello,&lt;br&gt;
I've created a Movie recommendation program that allows you to search for movies by typing the first letter of the genre you wish to enter. The movie data is stored in a dictionary which holds the genres as keys, and the movies as values. I then created a few loops that will go over the user's input with the goal of returning the user with a first a list of genres then a list of movies from the selected genre. Next is more_recommendations function to allow for multiple uses of the program. Followed by the present_recommendations function to neatly show the list of movie recommendations. I enjoyed creating this program, I'm looking forward to learning more complex data structures/algorithms that I could use with same data. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hrgr5qjzsfydo0iru9s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hrgr5qjzsfydo0iru9s.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxj6duv3tzmvco54w3mi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxj6duv3tzmvco54w3mi.png" alt="Image description" width="800" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a link to my Github repository:&lt;br&gt;
&lt;a href="https://github.com/dgilson74/MovieRecommender/tree/main" rel="noopener noreferrer"&gt;https://github.com/dgilson74/MovieRecommender/tree/main&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My First Python Project : Terminal Wordle</title>
      <dc:creator>Devon Gilson</dc:creator>
      <pubDate>Thu, 06 Mar 2025 20:49:39 +0000</pubDate>
      <link>https://dev.to/dgilson74/my-first-python-project-terminal-wordle-1e78</link>
      <guid>https://dev.to/dgilson74/my-first-python-project-terminal-wordle-1e78</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxx4mexu5n9rc3uvz9vo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxx4mexu5n9rc3uvz9vo.png" alt="Image description" width="800" height="548"&gt;&lt;/a&gt;&lt;br&gt;
Hello!&lt;br&gt;
The goal of my first python project was to create a small game that could played within a terminal. I chose the game Wordle as it's currently quite popular and the game is very simplistic with daily replay value.&lt;/p&gt;

&lt;p&gt;The few main sections of code focus on first: creating a random_word_selection function, second: create a eval_attempt function and third: write out a loop for what happens when the user guesses a certain way. The random_word_selection() function acts as a way to obtain a word from a text file randomly with random.choice(). Currently I've imported nltk to access a larger library of words than what I wrote in my text file. For the eval_attempt(), I used the (star),(+),(underscore) for encoding the list elements, then I created two lists one for the secret word (s2) and the attempt (a2) and proceeded to iterate over the types of guesses with pos and char as position and character. If the character in the attempt is in the right position and letter its marked a "star" and gets printed out green. If the guessed character is in the word but not the right position it's marked "+" and prints out yellow. If the character is not in the word at all its marked "underscore" and no colour is printed. In the last loop I wanted to return a string if you do not guess a five letter word or if you do get it right it will congratulate you! At the end if you don't guess in six tries it reveal the secret word to you and an option to replay or quit the game.&lt;/p&gt;

&lt;p&gt;I created Wordle as a simple terminal game that aims to provide a little daily puzzle similar to sudoku, crossword, etc. This code shows my beginner knowledge of functions, modules, loops and lists. &lt;/p&gt;

&lt;p&gt;Here is a link to the code:&lt;br&gt;
&lt;a href="https://github.com/dgilson74/WordleProject/blob/f6423bce66f870374dfcb4cc6340bfe9d5c38d1e/WordleProject.py" rel="noopener noreferrer"&gt;https://github.com/dgilson74/WordleProject/blob/f6423bce66f870374dfcb4cc6340bfe9d5c38d1e/WordleProject.py&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>terminal</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
