Microcontrollers, Design and Implementation released!

It was about two years I started serious study on computer architecture. In these years, I learned a lot and I could simulate and implement a microprocessor, similar to real ones. In Summer 2016, I decided to share my experience with others. Then, I started writing this book. This book has seventeen chapters, and after reading this book, you will have a concept of computer architecture.

Chapters

  • License – Licensing and Copyrights
  • Introduction – A quick review of the book, defining target audience of the book.
  • Chapter 1 : What’s a microcontroller? – This chapter, defines a microcontroller. After reading this chapter you’ll understand the internal parts of a microcontroller. It’s completely theory, but you need the concepts.
  • Chapter 2 : How to talk to computer? – In this chapter, we have a quick view on programming and then, machine language. We determine the word size of our processor in this chapter.
  • Chapter 3 : Arithmetic Operations – This chapter focuses on arithmetic operations in base 2.
  • Chapter 4 : Logical Operations – This is all about boolean algebra, the very basic introduction to logical circuits.
  • Chapter 5 : Logical Circuits – Our journey starts here, we learn how to make logics using NAND in this chapter, and then, we learn the logic gates.
  • Chapter 6 : Combinational Circuits – This chapter is where you learn how to combine simple logics together and make more complex logics. Actually, you learn how to implement Exclusive OR and Exclusive NOR using other gates.
  • Chapter 7 : The First Computer – In this chapter, we make a simple Addition Machine.
  • Chapter 8 : Memory – In this chapter, we just take a look on sequential circuits.
  • Chapter 9 : Register File – After we learned sequential circuits, we make registers and then, we make our register file.
  • Chapter 10 – Computer Architecture – In this chapter, we’ll learn theory and basics of computer architecture and organization .
  • Chapter 11 – Design, Advanced Addition Machine – In this chapter, we add memory blocks to our addition machine.
  • Chapter 12 – The Computer (Theory) – In this chapter, we decide about what our computer should do. Actually, we design a simple ISA.
  • Chapter 13 – Arithmetic and Logical Unit – Now, it’s time to design our ALU.
  • Chapter 14 – Program Structure – In this chapter we decide about programming and machine language, and we design a simple instruction code.
  • Chapter 15 – Microcontroller – And finally, we add the RAM to our ALU, and we’ll have our simple microcontroller.
  • Chapter 16 – Programming and Operating System – In this chapter, we actually talk about the software layer of computers.
  • Chapter 17 – The Dark Side of The Moon – The final chapter, is all about making real hardware, we take a look at transistors, integrated circuits and HDL’s here.

Link to PDF File : Download

Hexadecimal Decoder (Seven Segment)

You may use a seven segment to show time, temperature, voltage, etc. But, when you want to use it as an interface, specially on a simple computer, usual decoders (e.g. 7447) are not the best choice. You may need a shift-register or you may need to make a specific decoder for your computer display.  If you watch Ben Eater’s video about EEPROM,  You will find an Electrical Erasable ROM can be your decoder. But how? Imagine we have a common-cathode seven segment display. Then, We will have something like this for number zero :

dp g f e d c b a
0 0 1 1 1 1 1 1

So,  if we want to show a hexadecimal number, what will we need? Of course, we need to find which pins of our common cathode should be on for a specific number. In case of common anode displays, pins should be off.  Now, let’s design our Truth Table.

Number dp g f e d c b a
0 0 0 1 1 1 1 1 1
1 0 0 0 0 0 1 1 0
2 0 1 0 1 1 0 1 1
3 0 1 0 0 1 1 1 1
4 0 1 1 0 0 1 1 0
5 0 1 1 0 1 1 0 1
6 0 1 1 1 1 1 0 1
7 0 0 0 0 0 1 1 1
8 0 1 1 1 1 1 1 1
9 0 1 1 0 1 1 1 1
A 0 1 1 1 0 1 1 1
b 0 1 1 1 1 1 0 0
C 0 0 1 1 1 0 0 1
d 0 1 0 1 1 1 1 1
E 0 1 1 1 1 0 0 1
F 0 1 1 1 0 0 0 1

This is our truth table. Fortunately, Logisim can make a circuit from a truth table, but I made this circuit before. It looks like this :

The inputs W, X, Y and Z represent the BCD input. But how can make this thing? if you are interested to make one of these for real, you can use a 2816 chip, which is actually an EEPROM.

Hello world!

Hello World!

This is my first blog post in English. After years of blogging in my mother tongue, Persian, I decided to start writing in English. I think blogging in English is much better, because more people can read what I write, and also more eyes will see my posts and works. I’ll start writing my experiences here, as soon as possible.