PHPackages                             evandotpro/php-computer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. evandotpro/php-computer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

evandotpro/php-computer
=======================

A completely useless library of low-level computing concepts implemented in OOP PHP.

2183PHP

Since Feb 12Pushed 11y ago2 watchersCompare

[ Source](https://github.com/EvanDotPro/PhpComputer)[ Packagist](https://packagist.org/packages/evandotpro/php-computer)[ RSS](/packages/evandotpro-php-computer/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

The PHP Computer
================

[](#the-php-computer)

[![Build Status](https://camo.githubusercontent.com/65e61bcbe4977504a910eb91d9509f05b7f799923ed32710ffebdff2b40b344f/68747470733a2f2f7472617669732d63692e6f72672f4576616e446f7450726f2f506870436f6d70757465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/EvanDotPro/PhpComputer)

This project is the result of procrastination combined with my desire to improve my understandings of the lower level components of computers. Simply put, this is an OOP PHP representation of the lowest level components of a computer. I may or may not add more components as I learn and understand more, but I'll happily accept pull requests.

This project does not aim to have any practical use what-so-ever, aside from possibly entertainment or education value. However, it not necessarily aimed to help *teach* the concepts it represents, and is likely to make more sense to those who already have a basic understanding of how computers work at a low level. To get a better understanding of these concepts, I highly recommend the book [But How Do It Know](http://www.amazon.com/gp/product/0615303765) by J. Clark Scott.

**Note:** While this could conceivably be evolved into a hardware emulation layer for PHP (maybe?), that is *not* the goal of this project. Not only have I never looked at a single line of harware virtualization code in my life at the time of writing this, but it would also just be plain idiotic to attempt something like that with PHP. Stop thinking about such horrible things.

Oh, and if you like this, you'll probably also enjoy [JointJS's Logic Circuits](http://www.jointjs.com/demos/logic).

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "evandotpro/php-computer": "dev-master"
    }
}
```

Usage
-----

[](#usage)

#### Bit

[](#bit)

In computers, everything is made up of [bits](http://en.wikipedia.org/wiki/Bit). A bit is merely a unit of information (a circuit) that is either on (1) or off (0). That's it. So, we have a bit:

```
