Category: Computing

Kitten Technologies and OhBot Supporting Ada Lovelace Day (by )

Robo Rob part of the programming board game designed for Cuddly Science

Really wonderful news, the Cuddly Science event Ada Lovelace's Coding Time at the Museum of Gloucester on Saturday 14th Oct 2017 is not only having a wonderful OhBot Robot but also Simple Graphics by Kitten Technologies 😀

Kitten Technologies

This event is aimed at kids and is ticketed at £5 per child, there is puppet story telling, colouring in sheets, Robo Robs Jobs the board game as well as the OhBot programmable robot head and the simple graphics programme. I am very excited about how this event is shaping up 🙂

Oh Bot programmable robot head at the Cheltenham Fun Palace 2017

Ada Lovelace Day 2017 – Dr Rebecca Wilson (by )

Today is Ada Lovelace Day - an annul celebration of women in Science, Technology, Engineering and Maths (STEM), named after the Victorian mathematician and visionary Ada Lovelace.

Each year we try to do a little write up on women who have inspired us in the sciences. There are many entries for previous years - in fact later today I am going to make a special category for them all 🙂

This year I have chosen my friend Dr Rebecca Wilson.

Broken lift

Rebecca started off in Geology studying at Imperial College's Royal School of Mines, where she not only excelled in her own studies but helped me with some of the more advanced GeoChemistry elements, lending books and explaining things in multiple ways.

She was part of the posse that went with me to the Natural History Museum London to get work experience and helped me get into the meteoritics department. A PhD at the Planetary and Space Science Institute looking for organic material in micrometeorites.

She went on to post doc and research and science outreach at Leicester University and the associated Space Centre. During this time she developed some pretty awesome out reach kits. Those that can be available to the public/teachers are downloadable here.

Rebecca also won an science journalism internship which took her to Ireland, she has in fact been all over the globe studying, researching and presenting.

She has side stepped into medical data visualisation realm where she is pushing the frontiers of science ever forwards as well as highlighting the issues of accessibility on her various travels.

Rebecca has rubbed shoulders with the top people in both space and planetary science as well as within the deep data computering spheres not to mention the odd science communicator such as Brian Cox! Becca he is highly versatility and extremely dedicated and she is also a hell of a lot of fun to be around 🙂

She was even chosen by Jean for a school project on role models and heros!

Ada Lovelace’s Coding Time (by )

11 am to 1 pm Saturday Oct 14th 2017 I shall be taking Cuddly Science along to the Museum of Gloucester for an Ada Lovelace Day celebration tix £5 - the event is aimed at kids and will contain:

Ada the puppet explaining about herself and the technologies of the victorian era leading to modern day computing.

Ada Lovelace the puppet reading Equal Rites by Terry Pratchett

Colouring in sheets I have drawn of Ada, computers and other sundries - the photo is of the currently finished ones but there will be more before the weekend 🙂

Ada Lovelace Day Colouring in

Ada's friend Oh Bot Robot - a programmable robot head which the kids can complete programming tasks on including composing poetry!

Oh Bot programmable robot head at the Cheltenham Fun Palace 2017

Robo Robs Jobs - a board game that teaches children about the fundamentals of programming with out any scary numbers or computers 🙂 Very important to help engage all levels of understanding and expertise and the game can get a difficult as the players want!

Robo Rob part of the programming board game designed for Cuddly Science

Other bits and bobs 🙂 We are very excited about this Ada Lovelace day is an annual celebration of women in science, technology, engineering and medicine (STEM) and has events going on both nationally and internationally. These range from talks to shows to interactive events - check out where your nearest event is on the Ada site.

Septembers Events – 2017 (by )

Fri 1st Sept 11 am - 3 pm Gloucester: Community Craft Day at Gloucester Cathedral - upcycled accessories a Salaric Craft workshop.

Fri 1st-2nd Sept Cheltenham: Jean's performance as Joe in the Young Gloucester Opera and Dramatics Society's production of Fame at the Parabola Arts Centre.

Sun 3rd Sept Oxford: ICFP-International Conference on Functional Programming where Alaric will be speaking about the programming language Scheme part of Kitten Technologies.

Tues 5th 6:30 Stroud: Villanelles Poetry Evening with the Gloucester Poetry Society. Performance as part of The Wiggly Pets Press.

EDIT2: Talk is Wednesday lunchtime at the Museum of Gloucester.

EDIT: there is some confusion currently as to weather this talk is on Tues or Weds as the History Fest have it down as Tues and the Museum for Weds - Currently trying to sort it out 🙂

1pm Gloucester: The Start of Art general interest talk on cave and rock art at the [Museum of Gloucester](http://venues.gloucester.gov.uk/Freetime/Museums/events/Talks.aspx] part of the [Cuddly Science's)(http://www.salaric.co.uk/cuddly-science/) Histories.

Sat 9th 3-5pm Gloucester: Food For Thoughts at the Cafe Rene, poetry performance as part of The Wiggly Pets Press.

At three things to be confirmed later in the month 🙂

Processor architecture (by )

The current state of the art in processor design seems to be a reasonably complex instruction set, which is interpreted by a thing that translates it into a series of more primitive instructions which are then fed into some kind of multiple-issue pipelined thingy with speculative execution. You know, the kind of stuff x86 has been since the 386. 64-bit instructions, vector SIMD instructions, lots of cores and all that are just variations on the theme.

I'm sure this is a local maximum in the space of processor designs. So few of the transistors on each chip seem to be actual ALU doing something useful. All this translation and pipeline control seems to be a lot of logic that's just adapting to the impedance mismatch between the ALUs and instruction set...

So, I'm always interested in more exotic processor architectures, and there's two different threads I'd love to explore (as in, design and simulate in an FPGA) if I had time. The common theme is simple control logic; this means you can fit in more ALUs, or wide ALUs and registers, in the same space - or just fit more cores and more cache on the same die.

Zero-operand stack machines

The idea here is to use a stack instead of a register file. This means that instructions just need an operator (eg, "add") as the operands are implicit - the stack always provides the inputs and outputs. This means that the instructions can be very small due to the lack of operands; generally, much smaller than a machine word, so each word loaded can have several instructions in. This can mean that the memory bandwidth required to feed the chip with instructions is reduced; and since the decode and control logic becomes very simple, you can sustain a high clock rate with minimal pipelining, so reducing the memory bandwidth consumed by instruction loads is handy.

That means you can't fit literals or static addresses inside instructions, though, so you need something like a "load immediate" instruction that fetches the next word from the instruction stream and pushes it, rather than treating it as instructions. If an instruction word contains several "load immediate" instructions, then that many subsequent words of instruction stream could be literals!

One example of this approach is a Minimal Instruction Set Computer, but the concept is broader than that. Large instruction sets can be easily supported.

The control logic boils down to loading an instruction word, then treating it as a FIFO of smaller instructions to execute while the next instruction word is loading. Most instructions just engage an ALU circuit hardwired to the top element or two of the stack, whose output becomes the new top of stack. A few might transfer data to/from a memory access unit or a register, including the instruction pointer to change the flow of control. Not many gates are needed to decode an instruction, leading to the short cycle time.

Instructions that can't complete in a single cycle present a problem, though. The use of a stack tends to mean that an instruction depends on the result of the previous instruction, so it's tricky to execute several instructions in parallel and thus make progress in the presence of weighty multiply/divide instructions or memory reads.

I can think of three ways of overcoming that, and you can combine all three:

Multiple stacks

The approach taken by the 4stack processor is to have four stacks, each with its own independent ALU. Each instruction word has an instruction for each ALU in, and they execute in parallel on each clock tick. Presumably, there's some means to transfer results between the stacks - I imagine a bus joining them, an instruction to pop a value from the stack onto the bus, and an instruction to push from the bus. The timings of the bus reads and writes are such that it's possible to have an instruction word with a pop->bus from one stack and push->bus for one or more stacks that do such a transfer in a single cycle.

Due to the synchrony of instructions feeding into each ALU, we can't "stall" an ALU. If one of them executes a weighty instruction or has a cache miss on a memory read, we either stall ALL the ALUs at once, or we mandate that certain instructions are followed by a fixed number of NOPs before another instruction can execute, to allow time for it to complete.

This puts the onus on the compiler to schedule instruction-level parallelism, and means that the compiler needs to know the precise timings (and number of ALUs) of the target CPU - we can't use the same instruction set for a broad range of implementations!

Result registers

Weighty instructions might not put their results straight on the stack; instead, the instruction might cause the inputs to be pulled from the stack and the instruction starts executing. When it completes, the result is latched into a result register, and a later instruction pushes the contents of the result register (stalling if it's not ready yet). This means that the instruction stream can get on with other stuff while the lengthy instructions run. However, it requires such multi-cycle instructions to inherently work differently; and it puts some onus on the compiler to know how many instructions to wait between starting these instructions and trying to access their results for best performance.

Virtual stack

Finally, we can virtualise the values on the stack. A division instruction, for example, might read two actual values from the stack and then push a token that means "Wait for the result coming from division unit 7". If the next instruction is an addition, then it would read that token and (say) a literal value from the next stack position; since one of the inputs is a token it can't execute yet, but it still assigns an addition ALU and loads the literal value. But it tells division unit 7 to, when it completes, push the result into port 1 of addition ALU 3; and it pushes a token that means "Wait for the result coming from addition ALU 3", and so on. Basically, rather than waiting for operations to complete so you can push a value to the stack, you can instead push a reference to an operation in progress; a cluster of ALUs and memory access units connected by suitable buses then becomes a kind of dataflow machine which is fed connections from the instruction stream, in effect taking the condensed zero-operand instruction stream and using it to assign dependencies between instructions, rather than using virtual registers to assign dependencies as in current CPU designs. But this requires the kind of complex control logic that I feel current CPU designs are drowning in.

Transport-triggered architecture

Another way to simplify control logic is to build your CPU as a bunch of modules with input and output ports. Arithmetic and logic operation modules have one or two inputs and a single output; a memory reader has an address input and a data output; a memory writer has address and data inputs and no outputs; registers have an input and an output; and so on.

Each instruction contains a few bits to control whether the instruction executes conditionally on bits from a flag register, then an output port to read from, and an input port to write the result to. The decoding consists of checking the conditional execution flags then either doing nothing, or pushing the input and output port IDs onto two address busses and toggling a strobe line that causes the output port to write its contents to a data bus, and the input port to load from it.

As with the zero-operand stack machines, the instructions are small, so can probably cram several into a machine word - maybe split into groups that share a single set of conditional execution bits, for even more compactness. These instructions are all operand and no operator!

To insert literal values in the instruction stream, one can again have an output port on the instruction fetch module, that when read pulls a literal value from the instruction stream and stops it from being interpreted as instructions.

The output of each module is a register, where a value appears as soon as it's ready and waits until it's read - so there's no need to explicitly store it in a general purpose register. However, the CPU might have a few general-purpose registers anyway to store stuff in, as well as the usual instruction pointer, flags, and machine control registers.

This makes it easy to exploit parallelism; the instruction stream can trigger lots of modules and then come back later to read their output registers. The compiler might need to know the cycles required to do various things and not read the outputs until they're ready, or there might be handshaking on the internal bus so that instructions stall until an output is ready, which makes it easier to deal with things like memory reads that can take widely varying numbers of cycles to complete. Even then, the compiler can still benefit from knowing cycle timings in order to schedule stuff better.

Modules could be pipelined. Rather than having four multipliers, you might have one that you can feed (say) four sets of inputs into and then, later, read the output register four times to get the results. The compiler might need to know how deep the pipeline is to avoid overflowing it with results; or the hardware spec might mandate that up to sixteen multiplies can be pipelined, and put a FIFO on the output register to make up the extra capacity needed beyond the number of pipeline stages it has.

The downside is that the compiler needs to know how many modules there are and what port numbers are wired up to what. This, again, makes it hard to have a single executable that can run on a wide range of implementations of the design.

However, this looks rather like the execution model behind the virtual-stack machine discussed above - so perhaps we could have a generic stack-based instruction set that is executed by a virtual stack to generate instructions for an underlying transport-triggered machine...

Modules could be quite complex; for instance, an index register module might comprise a register coupled directly to a memory access system. By accessing different input or output registers, it could update the contents of the register, or write to the memory address stored in the register, or read from the memory address in the register; and different input/output ports could be accessed that cause it to pre- or post-increment or -decrement the index register at the same time, allowing for efficient operations on contiguous blocks of memory. Also, the internal data bus might be arbitrarily wide, allowing ALUs to operate on, and registers to store, vectors of several machine words; modules that only operate on a single word at a time might sacrifice a few input-port-select bits in their instructions to select which word from the vector on the data bus to read into their input port.

To save on space taken up by literals, we can have a simple module with output ports that produce some useful constants (0, 1, -1); or dedicate a single bit of the instruction to selecting whether the input port number field specifies an input port, or is a literal to just load onto the data bus. An input port number will be much smaller than a machine word, so this will only cater for small literals, but most literals are small and we can fall back onto fetching an entire word from the instruction module for larger literals. We might want to sign-extend a small literal, however.

The data bus might become a bottleneck, but that's OK - we can have several of them, and make the instructions specify an input and output port number for each bus; we then trigger multiple transfers in each instruction cycle. This is very similar to having several instructions in a machine word, except that they execute in parallel rather than serial. We just now need to specify what happens if the same port is read or written by two parallel transfers!

Conclusions

A general theme with many of the above approaches is that the compiler ends up needing to know more about the details of the chip implementation, because the compiler is responsible for more scheduling.

Perhaps this is no bad thing - runtime code generation is becoming the norm anyway, and it would be possible to bootstrap the system by having an initial "minimal instruction set" which is standardised, and allows access to a description of the current chip architecture; the runtime code generator can then be compiled (using a compiler written in the minimal instruction set), and then the processor switched into normal mode. This might even be implemented by having a simple version of the stack architecture as a front-end processor that starts executing code while the main CPU is dormant; it then has an instruction that hands an initial instruction pointer value to the dormant main CPU and starts it up. Multicore systems would need only one front-end processor to bring the whole system up!

Another approach might be to have a transport-triggered architecture with a small set of guaranteed modules available at well-known port numbers in every implementation, with variation occurring in the rest of the port-number space. But this requires the instruction format to have enough bits for the port numbers to allow for the largest imaginable processor, leading to unnecessarily wide instructions for smaller devices. Perhaps this can be handled by having the instruction decoder support both standard narrow instructions and implementation-specific wider instructions, again starting off in standard mode and allowing switching to wide mode once the processor definition has been read and used to compile the compiler that can exploit the full capabilities.

Either way, I think that future processor architectures might be more tightly coupled to the compilers than we're used to.

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales