<?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>Forem: Oku-Jo</title>
    <description>The latest articles on Forem by Oku-Jo (@okujo).</description>
    <link>https://forem.com/okujo</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%2F1051766%2F5a78217a-9fa1-45d4-be7b-b16347d95095.png</url>
      <title>Forem: Oku-Jo</title>
      <link>https://forem.com/okujo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/okujo"/>
    <language>en</language>
    <item>
      <title>Basic CPU Modeled in Python3</title>
      <dc:creator>Oku-Jo</dc:creator>
      <pubDate>Wed, 24 Jan 2024 22:17:25 +0000</pubDate>
      <link>https://forem.com/okujo/basic-cpu-modeled-in-python3-36a0</link>
      <guid>https://forem.com/okujo/basic-cpu-modeled-in-python3-36a0</guid>
      <description>&lt;p&gt;After completing the CodeCademy computer architecture course we have been tasked with using python to simulate the basic functions of a CPU.&lt;/p&gt;

&lt;p&gt;My finished project can be found here:&lt;br&gt;
&lt;a href="https://github.com/Oku-Jo/cpu-modeled-in-python3/tree/main"&gt;https://github.com/Oku-Jo/cpu-modeled-in-python3/tree/main&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project is relatively open ended, and CodeCademy has provided some basic mips32 instructions and a few lines of data to test our constructs with. I ended up using significantly more than what we were provided to test our models with, and am glad I had done so.&lt;/p&gt;

&lt;p&gt;I went into this knowing that I was going to struggle, so the goal I set for myself was to create a basic cpu that could handle a variety of randomly generated mips32 instructions (which adhere to the standard rules of mips32 instruction formatting) as well as an array of randomly generated data in addition to the provided instructions and data. I chose to do this so that I could be sure the model I was building was actually working, not just working with the provided data. I figured if I could build a simulated cpu that functions with externally-sourced instructions and data it would mean that I had gained a firm understanding of the material, both python3 and basic cpu architecture. The goal, after all, is to learn and to gain confidence that I have a good handle on what I've learned.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I have finished the cpu and it is currently handling instructions well, but my model was getting stuck in a loop with the full list of randomly generated instructions. I thought the source of my problem was somewhere in the structure of my model and spent far too long combing through and reorganizing everything only to realize that it might be the instructions causing the looping.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I have since gone through the instructions (which turned out to be the problem) and significantly curated them to create a cohesive set of instructions that handle branching and jumping very well. This allowed me to reuse many of the arithmetic instructions and to create a more interesting mips program.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second aspect of this project that I wanted to spend a bit of extra time on was the structuring of the memory, the cache, and the cpu register. I wanted to make the transferring of data between register&amp;lt;-&amp;gt;cache&amp;lt;-&amp;gt;memory as reliable as possible before trying to do anything fancy with cache associativity, flagging cache blocks as dirty to increase efficiency/reduce frequency of memory writes, and anything more complex than a first-in-first-out cache replacement policy. My goal for the register&amp;lt;-&amp;gt;cache&amp;lt;-&amp;gt;memory is a functioning cpu register that works 1:1 with the many mips32 instructions (eventually all, but for now I am trying to keep it simple), a &lt;em&gt;reliable&lt;/em&gt; fully associative cache with a FIFO policy (that can be updated in a future re-work), and a main memory structure that is quick to access using indices as addresses.&lt;/p&gt;

&lt;p&gt;I built a Register class that I ended up taking apart and incorporating into the CPU class as it was getting very long winded to write out the decode_and_execute method, plus it was becoming more and more convoluted and less readable for someone to just jump into with no prior understanding of how I have structured this simulated CPU. Overall I think this was the right choice.&lt;/p&gt;

&lt;p&gt;Shortcomings that I am aware of:&lt;br&gt;
-None of the register/cache/memory have limits on bits per address/location. This can be updated in the future, but for now I have done what I set out to accomplish.&lt;br&gt;
-None of this system uses binary or hex. In the future I can update this alongside adding limits to bits per location as well as how to handle results from the ALU being larger than bits-per-location allows, ie splitting and storing data as bytes vs half words vs words. This also includes updating how the Store Word mips32 instruction would handle the offset (+4/+8/+16 instead of +1 as it is currently).&lt;br&gt;
-Don't have all mips32 instructions built in, but enough to handle arithmetic, jumping, and branching&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Simple Movie Rec by Genre</title>
      <dc:creator>Oku-Jo</dc:creator>
      <pubDate>Thu, 19 Oct 2023 15:23:10 +0000</pubDate>
      <link>https://forem.com/okujo/simple-movie-rec-by-genre-19bb</link>
      <guid>https://forem.com/okujo/simple-movie-rec-by-genre-19bb</guid>
      <description>&lt;p&gt;Thanks for taking the time to read this. This is my first self-directed attempt at recommendation software. I am on the Codecademy CS track, and the assignment was to create any form of recommendation software I could come up with, and to include a form of autocomplete that would take minimal user input to suggest options they may have been considering.&lt;/p&gt;

&lt;p&gt;I know this could use a little sprucing up, and I think when I have time I may come back and add the larger MovieLens dataset and incorporate the MovieLens ratings dataset to help further refine the user search. Currently this program is using the small MovieLens dataset for academic purposes.&lt;/p&gt;

&lt;p&gt;Thanks again for your time!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Oku-Jo/Movie-Recommendations-by-Genre"&gt;https://github.com/Oku-Jo/Movie-Recommendations-by-Genre&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Come join me in being judgy about my first project! Welcome to Simpletarot!</title>
      <dc:creator>Oku-Jo</dc:creator>
      <pubDate>Thu, 30 Mar 2023 20:59:16 +0000</pubDate>
      <link>https://forem.com/okujo/come-join-me-in-being-judgy-about-my-first-project-welcome-to-simpletarot-4gn4</link>
      <guid>https://forem.com/okujo/come-join-me-in-being-judgy-about-my-first-project-welcome-to-simpletarot-4gn4</guid>
      <description>&lt;p&gt;It means a lot that you would take the time to check out my little python project!&lt;/p&gt;

&lt;p&gt;I am in the beginning stages of my coding competency, and I have been tasked with creating a python-based terminal game. I wanted to keep it simple to make sure I could complete the task, but also leave it open enough that I could iterate on it and introduce more user options and more complex code.&lt;/p&gt;

&lt;p&gt;For my project I have created a simple tarot reader. This tarot reader contains two tarot decks, each comprised of &lt;em&gt;only&lt;/em&gt; the major arcana cards to keep things manageable. The user is given the option to choose between a deck that &lt;em&gt;does&lt;/em&gt; consider card orientation and one that doesn't. After choosing the type of deck, the user is then asked to choose either a single card draw (think magic 8-ball), or a three card spread, representing past, present, and future, as well as supplemental information to aid in interpretation.&lt;/p&gt;

&lt;p&gt;I scraped a couple different tarot sites to gather the data, did a bit of manual cleaning-up of the data in google tables, and exported each deck to a csv file, both of which are included in the repository. In the script itself I turned the csv files into dictionaries in order to more easily present the data when a card (key) was drawn. To ensure no duplicates might be drawn, I wrote this program to create the deck dictionaries upon initialization, and then modify the dictionaries to remove key/value sets as cards were 'drawn.' This allowed me to keep things incredibly simple and functional, as my goal is to have a fully working product (and a learning experience).&lt;/p&gt;

&lt;p&gt;Please feel free to share this, it is pure flattery that anyone might enjoy my work. Please also feel free to offer more elegant solutions as notes, but keep in mind that I am new to this. I may not yet be able to wrap my head around the more esoteric structures.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Oku-Jo/simpletarot"&gt;https://github.com/Oku-Jo/simpletarot&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Also don't judge my readme too harshly. I intend to make it into an actual readme.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Special thanks to Nova for helping/teaching me the basics of data scraping!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>firstpost</category>
      <category>beginners</category>
      <category>python</category>
    </item>
  </channel>
</rss>
